On Mon, 2003-04-14 at 17:12, Yuji Yamano wrote:
> Ron Johnson <ron.l.johnson@cox.net> writes:
>
> > $ ls -1 |grep ' '
> > foo bar
> > foo snafu
> > $
> > $ for f in `ls -1 |grep ' '`;
> > > do
> > > echo "$f";
> > > done
> > foo
> > bar
> > foo
> > snafu
> >
> >
> > Naturally, I don't want that!!! What's the magical sequence of
> > characters to get it to print out the complete file names?
>
> How about this? It works fine for me on Darwin.
>
> localhost% for f in "`ls | grep ' '`";
> for> do
> for> echo "$f"
> for> done
> foo bar
> foo snafu
> localhost%
bash sure is making things difficult...
$ for f in "`ls -1 |grep ' '`";
> do
> x=`echo $f | tr ' ' '-'`
> echo "@$f@ @$x@"
> done
@foo bar
foo snafu@ @foo-bar-foo-snafu@
What I want is:
@foo bar@ @foo-bar@
@foo snafu@ @foo-snafu@
Thanks,
Ron
-- +-----------------------------------------------------------+ | Ron Johnson, Jr. Home: ron.l.johnson@cox.net | | Jefferson, LA USA http://members.cox.net/ron.l.johnson | | | | An ad currently being run by the NEA (the US's biggest | | public school TEACHERS UNION) asks a teenager if he can | | find sodium and *chloride* in the periodic table of the | | elements. | | And they wonder why people think public schools suck... | +-----------------------------------------------------------+ ___________________ Nolug mailing list nolug@nolug.orgReceived on 04/14/03
This archive was generated by hypermail 2.2.0 : 12/19/08 EST