You could see which files had the pattern by using grep(1):
% grep play * fire.txt: You're playing cold music on the bar room floor, playin.txt: I'm just playing in the band playin.txt: While I'm playing in the band playin.txt: For playing in the band truckin.txt: once told me you got to play your hand
% grep -l play * fire.txt playin.txt truckin.txt
Command substitution to the rescue.
Command substitution takes the output of a command and passes it on to the shell for further processing. To use it, place the command whose output you want inside of backticks (`) (Found as the unshifted meaning of the tilde (~) key on most keyboards)
% wc `grep -l play *` 34 219 1235 fire.txt 52 186 1151 playin.txt 69 421 2357 truckin.txt 155 826 4743 total
What if I want to look at the contents of a script that's in my path, but I don't know where?
% which sprinfo /tools/public/bin/sprinfo % cat `!!` cat `which sprinfo`
Check in all checked out files in the current view:
% ct ci -c "fixed all the bugs" `ct lsco -cvi -avo -s`
% set foo=`which sprinfo` % echo $foo /tools/public/bin/sprinfo % wc $foo 138 398 3146 /tools/public/bin/sprinfo % ls -l $foo -r-xr-xr-x 1 vobadm 3146 Aug 27 15:06 /tools/public/bin/sprinfo % $foo usage: /tools/public/bin/sprinfo <SPR NUMBER>... or: /tools/public/bin/sprinfo -l <SPR NUMBER>
Up to the TTTT index
Tuesday Tiny Techie Tips are all © Copyright 1996-1997 by Jeff Youngstrom. Please ask permission before reproducing any of this material.