shell redirection

2010-02-02 Thread Stefan Miklosovic
hi I have a shell script and I would like to do something like this $ ./script.sh somefile After that, I can, just say, write content of that file on the screen. I would like to know, how to do that in script, I dont know that tricky redirection things ... thanks a lot

Re: shell redirection

2010-02-02 Thread Igor V. Ruzanov
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Tue, 2 Feb 2010, Stefan Miklosovic wrote: |hi | |I have a shell script and I would like to do something like this | |$ ./script.sh somefile | You could do kind of the following things: example.sh: #!/bin/sh read new /dev/stdin echo $new After

Re: Bourne shell redirection of STDOUT

2002-09-29 Thread parv
in message [EMAIL PROTECTED], wrote Jimmy Lantz thusly... I wonder if anyone know a way to redirect the STDOUT directly to a variabel in a shellscript w/o using tempfile. I know I can use a tempfile but I'm looking for a way to avoid using a file. you could use pipe (fifo) and/or, in bash2

Re: Bourne shell redirection of STDOUT

2002-09-29 Thread parv
in message [EMAIL PROTECTED], wrote parv thusly... you could use pipe (fifo) and/or, in bash2 ksh93, arrays. a pipe is created by mkfifo(1); fill an array in a while loop. argh, never mind... better suggestions already made. sorry for the noise... -- To Unsubscribe: send mail to [EMAIL

Bourne shell redirection of STDOUT

2002-09-28 Thread Jimmy Lantz
Hi, I wonder if anyone know a way to redirect the STDOUT directly to a variabel in a shellscript w/o using tempfile. I know I can use a tempfile but I'm looking for a way to avoid using a file. in other words Does anyone have an alternative to this? I would like to be able to run this script

Re: Bourne shell redirection of STDOUT

2002-09-28 Thread Mikko Työläjärvi
On Sat, 28 Sep 2002, Jimmy Lantz wrote: Hi, I wonder if anyone know a way to redirect the STDOUT directly to a variabel in a shellscript w/o using tempfile. Use backticks ``. I know I can use a tempfile but I'm looking for a way to avoid using a file. in other words Does anyone have

Re: Bourne shell redirection of STDOUT

2002-09-28 Thread Oliver Fromme
Jimmy Lantz [EMAIL PROTECTED] wrote: Does anyone have an alternative to this? I would like to be able to run this script read-only : #!/bin/sh DIALOG=${DIALOG=/usr/bin/dialog} dialog --inputbox Hitme 8 40 \ 2 /tmp/tempfile myvar=`cat /tmp/tempfile` Nice example of abuse of cat.