[Dclug] useful bash shell function

Aaron M. Ucko amu at alum.mit.edu
Tue Oct 5 20:23:28 EDT 2010


James Ewing Cottrell 3rd <JECottrell3 at comcast.net> writes:

> function mkmv { dir=$1; shift; mkdir -p $dir&&  mv -t "$*" $dir; }

"$*" expands to a single argument, which won't generally do what you
want; "$@" is a better choice.

-- 
Aaron M. Ucko, KB1CJC (amu at alum.mit.edu, ucko at debian.org)
http://www.mit.edu/~amu/ | http://stuff.mit.edu/cgi/finger/?amu@monk.mit.edu


More information about the Dclug mailing list