Linux Shell Programming: Pocket Primer by Oswald Campesato
Author:Oswald Campesato
Language: eng
Format: epub
Publisher: Mercury Learning and Information
Searching zip Files for a String
There are at least three ways to search for a string in one or more zip files. As an example, suppose that you want to determine which zip files contain SVG documents.
The first way is shown here:
for f in `ls *zip` do echo "Searching $f" jar tvf $f |grep "svg$" done
When there are many zip files in a directory, the output of the preceding loop can be verbose, in which case you need to scroll backward and probably copy/paste the names of the files that actually contain SVG documents into a separate file. A better solution is to put the preceding loop in a shell and redirect its output. For instance, create the file findsvg.sh whose contents are the preceding loop, and then invoke this command:
./findsvg.sh 1>1 2>2
Notice that the preceding command redirects error message (2>) to the file 2 and the results of the jar/grep command (1>) to the file 1.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7745)
Filmora Efficient Editing by Alexander Zacharias(5464)
The Infinite Retina by Robert Scoble Irena Cronin(4910)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3910)
Learn Wireshark - Fundamentals of Wireshark. by Lisa Bock(3802)
Edit Like a Pro with iMovie by Regit(3251)
Linux Administration Best Practices by Scott Alan Miller(2849)
Linux Command Line and Shell Scripting Techniques by Vedran Dakic & Jasmin Redzepagic(2824)
MCSA Windows Server 2016 Study Guide: Exam 70-740 by William Panek(2512)
Docker on Windows by Stoneman Elton(2311)
Kali Linux - An Ethical Hacker's Cookbook: End-to-end penetration testing solutions by Sharma Himanshu(2300)
Mastering PowerShell Scripting - Fourth Edition by Chris Dent(2226)
Hands-On AWS Penetration Testing with Kali Linux by Karl Gilbert(2099)
Creative Projects for Rust Programmers by Carlo Milanesi(2057)
Hands-On Linux for Architects by Denis Salamanca(2034)
Computers For Seniors For Dummies by Nancy C. Muir(1988)
Programming in C (4th Edition) (Developer's Library) by Stephen G. Kochan(1978)
The Old New Thing by Raymond Chen(1932)
Linux Kernel Debugging by Kaiwan N Billimoria(1757)
