I want to use awk and the system()
function to move a couple of directories around.
I have a file that I want to process with awk
names file.cfg
which is organized in the following way:
/path1 /path2
/some_path /some_other_path
and so on..
each first path is separated from the second path by a whitespace So here's how I did it:
awk '{system(mv -R $1" "$2)}' file.cfg
but it doesn't work and I get
sh: 0/home/my_user/path1: No such file or directory
But file.cfg
looks like this:
/home/my_user/path1 /home/my_user/path2
and there is no 0 before /home
. So what am I missing here?