[ale] BASH question
Michael Potter
michael at potter.name
Sun Jun 26 16:02:49 EDT 2011
cd /media/*
will fail if there is more than one item in /media.
On Sun, Jun 26, 2011 at 3:58 PM, John Pilman <jcpilman at gmail.com> wrote:
> I want to write a shell script or alias to allow me to cd to a
> particular directory more easily.
>
> When I plug in a flash drive, it gets mounted automatically in
> /media/102B-1B76, only the last nine characters are not always the
> same. Since usually there is only one directory in /media I want a
> command that will cd to that directory.
>
> I tried
> /media$ find . -mindepth 1 -type d -prune|sed 's:./::'|xargs cd
> but I get
> xargs: cd: No such file or directory
> however
> /media$ find . -mindepth 1 -type d -prune|sed 's:./::'
> returns
> 102B-1B76
>
> I have also tried the -print0 option, but without further success.
> Any ideas?
> ...John
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
--
Michael Potter
Replatform Technologies, LLC
+1 770 815 6142
michael at potter.name
More information about the Ale
mailing list