The issue is exactly what did the original poser want to do? It all comes down to the right tool for the right job. One of the homework assignments I give to my students to write as a Korn Shell script is rather challenging, but can be performed with ease using AWK. awk 'BEGIN { print headings } { print $1, $2, $4, $3, $3 * $4 }' < file Or, you can set up awk in a script: #!awk -f BEGIN { -- begin stuff -- } condition { action } condition { action } END { end stuff like totals } Like perl, awk has associative arrays. It all comes down to what do you need to do, and what tool is the most appropriate for the job. Perl's intent was to subsume both awk and sed. Passing parameters to system() is simple: command=sprintf("%s %s $s", "Linux command", option1, option2) system(command) You can easily concatenate stuff to the command variable You can also pipe things to commands. Most people think about AWK as an inline command: awk 'script' file On 9 May 2002 at 14:17, Christopher Mahmood wrote:
* Jerry Feldman (gerald.feldman@hp.com) [020509 13:22]:
I would probably say less awkward in awk, since awk reads each line in a file automatically where in a shell script you must read each line individually in a loop.
awk won't help much here I think since there's not easy way to pass variables to a system(). If I had to I'd do something like:
awk '{ print $0 }'< file_with_args | xargs -n1 ls
Ugly.
What did you have in mind?
--
-ckm
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com
-- Jerry Feldman Portfolio Partner Engineering 508-467-4315 http://www.testdrive.compaq.com/linux/ Hewlett-Packard Company 200 Forest Street MRO1-3/F1 Marlboro, Ma. 01752