Hi,
I am writing a script to use awk to generate a set of cp commands from an input file abc.
file abc:
/data/a.dbf
/data/june/b.dbf
desired output:
cp -
pr a.dbf /data/a.dbf
cp -
pr b.dbf /data/june/b.dbf
script:
$ cat abc | awk '{ print "cp -
pr '`basename $1`' " $1 }'
I tried to use awk with basename command, but it seems that the field $1 in backquotes is not recognized by awk. How to fix it?
Many thanks,
voa2mp3