[Techtalk] Joining commands together in bash
showercurtain2000 at yahoo.com
Sun May 11 04:20:23 EST 2003
I'm making a script that will display the filenames of any
shellscripts in a directory and display the first few lines of each
script below each filename. So far I've come up with 2 commands for
head -n 3 *
Displays first 3 lines of any file in current directory
file * | grep 'shell script text executable'
Displays filenames of shell scripts
The problem is that I can't find a way to join them together to make
them work. If I do:
file * | grep 'shell script text executable' | head -n 3 *
I get filenames of shell scripts AND the first 3 lines of any file in
current directory. Head doesn't display the first 3 lines of
shellscripts. Can anyone suggest another way to join them together?
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
More information about the Techtalk