I have the following command :ls /some/path/*dat | xargs -n 1 -I @ sh -c echo `basename @`with the directory /some/path/ containing :/some/path/a/some/path/b/some/path/c/some/path/dI want to get the output :abcdBut I'm still getting full paths. What am I doing wrong ?edit: BTW, I know that there is an easier way, I can just run basname instead ofecho `basename @`But I need to run a complex command, something likeoctave --silent --eval somefunction('`basename @`','@',...))edit2:Here is the actual command : ls ~/phd/data/conll2012/dev.megam/*dat | xargs -P 16 -n 1 -I@ timeout -k 1s 15m sh -c if [ ! -f '~/phd/xp/conll2012/dev.megam/@.$epsilon$mink$minn$alpha' ]; then octave --silent --eval \xprp('~/phd/xp/conll2012/dev.megam/@.$epsilon$mink$minn$alpha.rp','@',$alpha,$mink,$minn,$epsilon);\ 2>> ~/xpgrid.log;fiBasically, I have a set of files in a directory and this command feeds on these files to output result in another directory, checking if the result is not already there.So, I need both files with fullpath and files with only basename.How to make it work on ? The easier example at the beginning can help make this clearer.
echoing basename under xargs?
bash;shell;quoting;xargs