Quote:
Originally Posted by
joeyg
Shell scripting will allow you to quickly perform more involved commands. And, you will more naturally learn as you chain one process into the next. For instance, you probably already know the ls command, but you can combine it with other commands to get (perhaps) better info. Thus, you could ls | grep "smith" to find filenames with "smith" in them. Next, you might decide to do a loop around those results to determine whatever.
Anyway, shell scripting is simply an extension of the shell commands.
So... I would start with shell scripting.
Agreed, and Frank, you too.
find /my/dir -maxdepth 1 -type f -not -name *bz2 -exec bzip2 {} \; FTW baby!
None of this ls stuff, BASH is where the action is at.
And perl is where the trickiness is made do-able.
while (<>) {
if ($_ =~ /\S+ (\S+)\s+(\d+)/) {
print 'Index ' . $1 . ' has ' . $2 . ' functions.' . "\n";
}
}
Then mix them together:
find /my/dir -maxdepth 1 -type f -not -name *bz2 |my_perl.pl |grep -i "fancy" |awk '{ print ( $4 }' |less
Feel the powers for different tasks...
I mean lets be honest you cannot sys admin without BASH (or SH/KSH)