feeding a script from standard input
I have a script, call it genpyste that looks like this:
#!/bin/sh pyste --out=. --multiple --module=mymodule Parameter.pyste
The problem with it is that this is just a start of it.
When I'm done, there will need to be about 30 parameters like Parameter.pyste.
I'm wondering if I can do something like this from the command line:
ls *.pyste | ./genpyste
What, if anything, can be done to the genpyste script to work like this?
On Mon, 2004-01-26 22:04:16 -0800, Jeffrey Holle <[email protected]> wrote in message <[email protected]>:
Quoted 9 lines
I have a script, call it genpyste that looks like this:
#!/bin/sh pyste --out=. --multiple --module=mymodule Parameter.pysteThe problem with it is that this is just a start of it. When I'm done, there will need to be about 30 parameters like Parameter.pyste.
Quoted 5 lines
I'm wondering if I can do something like this from the command line:
ls *.pyste | ./genpyste
What, if anything, can be done to the genpyste script to work like this?
Why not make it like this:
#!/bin/sh
pyste --out=. --multiple --module=mymodule "$*"
and then call it like
$ ./genpystr *.pyste
MfG, JBG
Signature · 4 lines
Jan-Benedict Glaw [email protected] . +49-172-7608481 "Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg fuer einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
Thanks for this, works without the quotes!
Quoted 28 lines · Jan-Benedict Glaw
On Mon, 2004-01-26 22:04:16 -0800, Jeffrey Holle <[email protected]> wrote in message <[email protected]>:
Quoted 5 lines
I have a script, call it genpyste that looks like this:
#!/bin/sh pyste --out=. --multiple --module=mymodule Parameter.pysteQuoted 8 lines
The problem with it is that this is just a start of it.
When I'm done, there will need to be about 30 parameters like Parameter.pyste.I'm wondering if I can do something like this from the command line:
ls *.pyste | ./genpyste
What, if anything, can be done to the genpyste script to work like this?
Why not make it like this:
#!/bin/sh
pyste --out=. --multiple --module=mymodule "$*"and then call it like
$ ./genpystr *.pysteMfG, JBG
Quoted 1 line · Jeffrey Holle
Thanks for this, works without the quotes!
Better to use "$@".
Otherwise if you do something like *.foo and any of those names has spaces in it, it would fail. Only "$@" will get that case right.
Even the people who designed that feature call it magic.
mrc
Signature · 3 lines
Mike Castle [email protected] www.netcom.com/~dalgoda/ We are all of us living in the shadow of Manhattan. -- Watchmen fatal ("You are in a maze of twisty compiler features, all different"); -- gcc
On Wed, 2004-01-28 23:30:16 -0800, Mike Castle <[email protected]> wrote in message <[email protected]>:
Quoted 4 lines · Jeffrey Holle
Quoted 1 line
Thanks for this, works without the quotes!
Better to use "$@".
That was actually ment - sorry for confusion.
MfG, JBG
Signature · 4 lines
Jan-Benedict Glaw [email protected] . +49-172-7608481 "Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg fuer einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));