bash - awk system call -


i want use awk , system() function move couple of directories around. have file want process awk names file.cfg organized in following way:

/path1 /path2  /some_path /some_other_path  , on.. 

each first path separated second path whitespace here's how did it:

awk '{system(mv -r $1" "$2)}' file.cfg

but doesn't work , get

sh: 0/home/my_user/path1: no such file or directory

but file.cfg looks this:

/home/my_user/path1 /home/my_user/path2

and there no 0 before /home. missing here?

you have quote command give system:

awk '{system("mv -r " $1 " " $2)}' file.cfg 

currently mv -r interpreted value of variable mv minus value of r, 0 since neither defined.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -