newbie question - how to pass textfile as an argument

Dan Nelson dnelson at allantgroup.com
Wed Oct 1 13:32:11 PDT 2003


In the last episode (Oct 01), Martin Vana said:
> I was just wondering if there is a way how to pass a text file with
> list of path/files to programs like cp/mv.

If the list is small (less than 65000 characters total):

  cp $(cat myfile) /otherdir/

If the list is large:

  xargs < myfile -J% cp % /otherdir/

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-questions mailing list