[Techtalk] filtering command line
anisa khan
anisa.khan at yahoo.co.uk
Mon Jun 11 12:26:13 UTC 2007
maybe you will find what you need here:
http://unxutils.sourceforge.net/
and a simple 'tr' might even do
tr [oldchar] [newchar]
ie. tr \/ \\
hope this helps you along a bit further
AK
----- Original Message ----
From: Miriam English <mim at miriam-english.org>
To: Tech Talk <techtalk at linuxchix.org>
Sent: Monday, 11 June, 2007 1:42:03 PM
Subject: [Techtalk] filtering command line
Hi folks,
I need to send a file name along with its path to a program running
under Wine on Linux. Originally I used a little script:
#! /bin/sh
if [$1 = ""]; then
wine c:\\textpad\\TextPad.exe
else
wine c:\\textpad\\TextPad.exe "z:$@"
fi
Which worked fine for TextPad (a brilliantly flexible programmers text
editor), but fails for irfanview (a superb, small, fast picture
viewer/converter). At first I was stumped as to why this would be so,
but then I began to suspect it was because TextPad was able to cope with
"/" characters in the path, but irfanview required "\".
Does anybody know a very simple filter to substitute "\" for "/" in the
passed file path?
After doing a fair bit of reading I have a feeling I might need to use
sed with something like
s/\//\\/g
Trouble is I've never used sed before and I have no idea how I'd use it
in a shell script to get the input, and then to pass the filtered result
to the wine line.
Anybody know how? Or anybody know a better way?
Surely there is a simple command that does pattern replacement on a
command line.
Best wishes,
- Miriam
--
---------=---------=---------=---------=---------=---------=------
A life! Cool! Where can I download one of those from?
---------=---------=---------=---------=---------=---------=------
Website: http://miriam-english.org
Blog: http://miriam-e.livejournal.com
_______________________________________________
Techtalk mailing list
Techtalk at linuxchix.org
http://mailman.linuxchix.org/mailman/listinfo/techtalk
___________________________________________________________
Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for
your free account today http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.html
More information about the Techtalk
mailing list