[Techtalk] filtering command line

Michelle Konzack linux4michelle at freenet.de
Wed Jun 13 17:01:16 UTC 2007


Am 2007-06-12 01:30:25, schrieb Miriam English:
> Feedback for anybody attempting something similar...
> 
> I made this simple script:
> 
> #! /bin/sh
> 
> if [ $1 = "" ]; then
> 	wine c:\irfanview\i_view32.exe
> else
> 	echo "z:$@" | tr '/' '\' > /tmp/iview_start
> 	export iview_start=`cat /tmp/iview_start`
> 	wine c:\irfanview\i_view32.exe "$iview_start"
> fi

What about:

if [ $1 = "" ]; then
	wine c:\irfanview\i_view32.exe
else
	wine c:\irfanview\i_view32.exe "$(echo "z:$@" |sed 's|\\|/|g')"
fi

which is much shorter.



Greetings
    Michelle Konzack
    Systemadministrator
    Tamay Dogan Network
    Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSN LinuxMichi
0033/6/61925193    67100 Strasbourg/France   IRC #Debian (irc.icq.com)


More information about the Techtalk mailing list