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(7353)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3454)
MCSA Windows Server 2016 Study Guide: Exam 70-740 by William Panek(2318)
The Infinite Retina by Robert Scoble Irena Cronin(2275)
Kali Linux - An Ethical Hacker's Cookbook: End-to-end penetration testing solutions by Sharma Himanshu(2106)
Docker on Windows by Stoneman Elton(2094)
Hands-On AWS Penetration Testing with Kali Linux by Karl Gilbert(1855)
Computers For Seniors For Dummies by Nancy C. Muir(1775)
Hands-On Linux for Architects by Denis Salamanca(1757)
The Old New Thing by Raymond Chen(1726)
Filmora Efficient Editing by Alexander Zacharias(1713)
Programming in C (4th Edition) (Developer's Library) by Stephen G. Kochan(1710)
MCSA Windows Server 2016 Study Guide: Exam 70-741 by William Panek(1484)
Installing and Configuring Windows 10: 70-698 Exam Guide by Bekim Dauti(1425)
Mastering PowerShell Scripting - Fourth Edition by Chris Dent(1416)
Embedded Systems Architecture by Daniele Lacamera(1387)
Mastering Kubernetes by Gigi Sayfan(1369)
Learn Computer Forensics by William Oettinger(1360)
Database Reliability Engineering: Designing and Operating Resilient Database Systems by Campbell Laine & Majors Charity(1351)