Unix Shell - Re: Shell script - Copy files from Src to Dst from a sample test

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > November 2005 > Re: Shell script - Copy files from Src to Dst from a sample test





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: Shell script - Copy files from Src to Dst from a sample test
Ed Morton

2005-11-16, 6:03 pm

tester wrote:

>
> the awk syntax was wrong. awk -F, '{print $1/$2}' $line


There's nothing wrong with that syntax. Looking back through the thread
(and please read http://cfaj.freeshell.org/google so that's not
necessary in future), I see this line:

srcpath=awk -F, '{print $1/$2}' $line

Now THAT is wrong, but it's not the awk syntax, it's the shell. It
should've been:

srcpath=`awk -F, '{print $1/$2}' "$line"`

assuming that "$line" is the name of as file, e.g. "Sample" as used below.

>
>
> temp file replaces comma delimiter with / and put in to the same logic
> as before with temp file.


If you fix your shell line as above, you don't need the tmp file.

>



Ah, now I see that awk line again. Please pay particular attention to
the part about "top-posting" in the page I referred you to.

Ed.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com