[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: variablen durch pipes (bash)



* Michelle Konzack <linux4michelle@freenet.de>:
> Am 2005-03-28 00:59:52, schrieb Stefan Muthers:
> 
> > > for PIC in `find -name "*.gif"` ; do
> > >     giftopnm $PIC |pnmtojpeg > `dirname $PIC`/`basename $PIC`.jpg
> > > done
> > 
> > aber auch hier gibt es bei `dirname $PIC` und `basename $PIC` Probleme, wenn $PIC
> > Leerzeichen enthält.
> 
> for PIC in `find -name "*.gif"` ; do
>     giftopnm "$PIC" |pnmtojpeg > `dirname "$PIC"`/`basename "$PIC"`.jpg
> done
> 
> jetzt nicht mehr :-)
also bei mir geht das so immer noch nicht.

  __( 'bsp' )_____________________________________________________
 /
| ## ls -l
| insgesamt 0
| -rw-r--r--  1 grau grau 0 2005-03-28 12:37 2
| -rw-r--r--  1 grau grau 0 2005-03-28 12:40 23. 11. 2014 war _der_ Tag
| -rw-r--r--  1 grau grau 0 2005-03-28 12:37 3
| -rw-r--r--  1 grau grau 0 2005-03-28 12:38 ls al asd asl
|
| ## for i in *; do echo `basename "$i"`; done  # das klappt
| 2
| 23. 11. 2014 war _der_ Tag
| 3
| ls al asd asl
|
| ## for i in `find .`; do echo `basename "$i"`; done # das klappt nicht
| .
| 2
| 3
| ls
| al
| asd
| asl
| 23.
| 11.
| 2014
| war
| _der_
| Tag
| 
 \______________________________________________________________________

So klappt es aber auch mit Leerzeichen:
 ## find .| while read file; do echo `basename "$file"`;  done

ciao
	Stefan



Reply to: