linux-console.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* feeding a script from standard input
@ 2004-01-27  6:04 Jeffrey Holle
  2004-01-28 14:05 ` Jan-Benedict Glaw
  0 siblings, 1 reply; 5+ messages in thread
From: Jeffrey Holle @ 2004-01-27  6:04 UTC (permalink / raw)
  To: linux-console

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?



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: feeding a script from standard input
  2004-01-27  6:04 feeding a script from standard input Jeffrey Holle
@ 2004-01-28 14:05 ` Jan-Benedict Glaw
  2004-01-28 20:34   ` Jeffrey Holle
  0 siblings, 1 reply; 5+ messages in thread
From: Jan-Benedict Glaw @ 2004-01-28 14:05 UTC (permalink / raw)
  To: linux-console

[-- Attachment #1: Type: text/plain, Size: 1060 bytes --]

On Mon, 2004-01-26 22:04:16 -0800, Jeffrey Holle <jeff.holle@verizon.net>
wrote in message <bv4v6h$rlc$1@sea.gmane.org>:
> 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?

Why not make it like this:

#!/bin/sh
pyste --out=. --multiple --module=mymodule "$*"

and then call it like
$ ./genpystr *.pyste

MfG, JBG

-- 
   Jan-Benedict Glaw       jbglaw@lug-owl.de    . +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));

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: feeding a script from standard input
  2004-01-28 14:05 ` Jan-Benedict Glaw
@ 2004-01-28 20:34   ` Jeffrey Holle
  2004-01-29  7:30     ` Mike Castle
  0 siblings, 1 reply; 5+ messages in thread
From: Jeffrey Holle @ 2004-01-28 20:34 UTC (permalink / raw)
  To: linux-console

Thanks for this, works without the quotes!

Jan-Benedict Glaw wrote:
> On Mon, 2004-01-26 22:04:16 -0800, Jeffrey Holle <jeff.holle@verizon.net>
> wrote in message <bv4v6h$rlc$1@sea.gmane.org>:
> 
>>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?
> 
> 
> Why not make it like this:
> 
> #!/bin/sh
> pyste --out=. --multiple --module=mymodule "$*"
> 
> and then call it like
> $ ./genpystr *.pyste
> 
> MfG, JBG
> 



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: feeding a script from standard input
  2004-01-28 20:34   ` Jeffrey Holle
@ 2004-01-29  7:30     ` Mike Castle
  2004-01-30 15:30       ` Jan-Benedict Glaw
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Castle @ 2004-01-29  7:30 UTC (permalink / raw)
  To: Jeffrey Holle; +Cc: linux-console

On Wed, Jan 28, 2004 at 12:34:17PM -0800, Jeffrey Holle wrote:
> 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
-- 
     Mike Castle      dalgoda@ix.netcom.com      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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: feeding a script from standard input
  2004-01-29  7:30     ` Mike Castle
@ 2004-01-30 15:30       ` Jan-Benedict Glaw
  0 siblings, 0 replies; 5+ messages in thread
From: Jan-Benedict Glaw @ 2004-01-30 15:30 UTC (permalink / raw)
  To: linux-console

[-- Attachment #1: Type: text/plain, Size: 644 bytes --]

On Wed, 2004-01-28 23:30:16 -0800, Mike Castle <dalgoda@ix.netcom.com>
wrote in message <20040129073016.GA370@thune.mrc-home.com>:
> On Wed, Jan 28, 2004 at 12:34:17PM -0800, Jeffrey Holle wrote:
> > Thanks for this, works without the quotes!
> 
> Better to use "$@".

That was actually ment - sorry for confusion.

MfG, JBG

-- 
   Jan-Benedict Glaw       jbglaw@lug-owl.de    . +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));

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-01-30 15:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-27  6:04 feeding a script from standard input Jeffrey Holle
2004-01-28 14:05 ` Jan-Benedict Glaw
2004-01-28 20:34   ` Jeffrey Holle
2004-01-29  7:30     ` Mike Castle
2004-01-30 15:30       ` Jan-Benedict Glaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).