Re: cgi-script shell script wrapping question

2010-12-28 Thread Lev Olshvang
Hi, I would go to the javascript wrapper solution : I would wrap cgi-script to send javascript code to browser and then redirect original script output to the html file In a javascript I would loop (and sleep) until load of html file will succeed. On 12/27/2010 08:26 PM, Dov Grobgeld wrot

Re: cgi-script shell script wrapping question

2010-12-27 Thread Dov Grobgeld
Thanks for the help! Based on it I tried running the command with python as follows: import subprocess pipe = subprocess.Popen("do_slow_command 2>&1", bufsize=1, stdout=subprocess.PIPE, stdin=subprocess.PIPE, shell=True) for p in pipe.stdout.readlines(): p

Re: cgi-script shell script wrapping question

2010-12-27 Thread ik
2010/12/27 shimi > > > 2010/12/27 Dov Grobgeld > >> I'm trying to write a cgi wrapper for a long running command. The command >> takes about 10minutes to execute and when running it from the command line >> it continously outputs text to stdout. A simplistic cgi-bin wrapper that >> tries to exec

Re: cgi-script shell script wrapping question

2010-12-27 Thread shimi
2010/12/27 Dov Grobgeld > I'm trying to write a cgi wrapper for a long running command. The command > takes about 10minutes to execute and when running it from the command line > it continously outputs text to stdout. A simplistic cgi-bin wrapper that > tries to execute the script and then writes

Re: cgi-script shell script wrapping question

2010-12-27 Thread ik
If you can send once in a while data to the output of the cgi, but not to finish the execution so it's pipe to the HTTP server will not terminate and the request will not end, then it should work, because there is a response, it's just keep on going, however if you do not send a thing, then the tim

cgi-script shell script wrapping question

2010-12-27 Thread Dov Grobgeld
I'm trying to write a cgi wrapper for a long running command. The command takes about 10minutes to execute and when running it from the command line it continously outputs text to stdout. A simplistic cgi-bin wrapper that tries to execute the script and then writes that it is done fails with the fo

Re: Preserving Blanks in Parameters to Shell Script

2010-06-14 Thread Tzafrir Cohen
On Mon, Jun 14, 2010 at 11:02:11PM +1000, Amos Shapira wrote: > On 14 June 2010 22:48, Aharon Schkolnik wrote: > > On Monday, June 14, 2010, Noam Meltzer wrote: > >> use $@ instead of $* > > > > Does that work for you ? > > > > I still get the same results - the script treates file\ one as two > >

Re: Preserving Blanks in Parameters to Shell Script

2010-06-14 Thread Shlomi Fish
On Monday 14 Jun 2010 15:27:43 Aharon Schkolnik wrote: > Hi. > > I want to write a script which will nice ffmpeg whatever parameters it is > given - ie: > > #!/bin/sh > > nice ffmpeg $* > > # > > > However, what if I have a file named `file one' > > > I would like to type `myscript -i file\

Re: Preserving Blanks in Parameters to Shell Script

2010-06-14 Thread Herouth Maoz
Quoting Noam Meltzer : use $@ instead of $* But put it in quotes: "$@". Otherwise the effect is lost. Herouth ___ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

Re: Preserving Blanks in Parameters to Shell Script

2010-06-14 Thread Aharon Schkolnik
On Monday, June 14, 2010, Noam Meltzer wrote: > I'm sorry. I tend to forget why I hate shell scripts. > Use "$@" instead. (checked it this time, it works ;-) ) Yep - looks like nice ffmpeg "$@" does the trick. Thanks ! > > 2010/6/14 Aharon Schkolnik > > > On Monday, June 14, 2010, Noam Melt

Re: Preserving Blanks in Parameters to Shell Script

2010-06-14 Thread Noam Meltzer
I'm sorry. I tend to forget why I hate shell scripts. Use "$@" instead. (checked it this time, it works ;-) ) 2010/6/14 Aharon Schkolnik > On Monday, June 14, 2010, Noam Meltzer wrote: > > use $@ instead of $* > > Does that work for you ? > > I still get the same results - the script treates fil

Re: Preserving Blanks in Parameters to Shell Script

2010-06-14 Thread Amos Shapira
On 14 June 2010 22:48, Aharon Schkolnik wrote: > On Monday, June 14, 2010, Noam Meltzer wrote: >> use $@ instead of $* > > Does that work for you ? > > I still get the same results - the script treates file\ one as two > parameters - file and one. 1. Try switching to #!/bin/bash - I think the "$@

Re: Preserving Blanks in Parameters to Shell Script

2010-06-14 Thread Aharon Schkolnik
On Monday, June 14, 2010, Noam Meltzer wrote: > use $@ instead of $* Does that work for you ? I still get the same results - the script treates file\ one as two parameters - file and one. > > On Mon, Jun 14, 2010 at 3:27 PM, Aharon Schkolnik wrote: > > Hi. > > > > I want to write a script

Re: Preserving Blanks in Parameters to Shell Script

2010-06-14 Thread Noam Meltzer
use $@ instead of $* On Mon, Jun 14, 2010 at 3:27 PM, Aharon Schkolnik wrote: > Hi. > > I want to write a script which will nice ffmpeg whatever parameters it is > given - ie: > > #!/bin/sh > > nice ffmpeg $* > > # > > > However, what if I have a file named `file one' > > > I would like to type

Preserving Blanks in Parameters to Shell Script

2010-06-14 Thread Aharon Schkolnik
Hi. I want to write a script which will nice ffmpeg whatever parameters it is given - ie: #!/bin/sh nice ffmpeg $* # However, what if I have a file named `file one' I would like to type `myscript -i file\ one output.whatever` I do not want to change what I type - the script needs to be a

Re: parameters to shell script

2009-12-08 Thread Tom Goren
awesome, thanks for the info. 2009/12/8 Amos Shapira > 2009/12/8 Tom Goren > > does it work with *su* (as opposed to over ssh)? >> >> i.e. *su - bybass -c "/Path/To/bypass.sh** param1 param2" >> >> *also, more information is definitely required, especially why you are >> trying to use this

Re: parameters to shell script

2009-12-08 Thread Amos Shapira
2009/12/8 Tom Goren > does it work with *su* (as opposed to over ssh)? > > i.e. *su - bybass -c "/Path/To/bypass.sh** param1 param2" > > *also, more information is definitely required, especially why you are > trying to use this script as the default user shell, which does not sound > like be

Re: parameters to shell script

2009-12-07 Thread Tom Goren
does it work with *su* (as opposed to over ssh)? i.e. *su - bybass -c "/Path/To/bypass.sh** param1 param2" *also, more information is definitely required, especially why you are trying to use this script as the default user shell, which does not sound like best practices... a shell is a shel

Re: parameters to shell script

2009-12-06 Thread Shay Ohayon
Try running the command its parameters inside quotes (") for example: ssh u...@host "command param1 paramN" I must say that it is quite difficult to provide you with a solution because I don't really know what the script does and how does it handles each parameter, it would be better if you can p

parameters to shell script

2009-12-06 Thread eliyahu cohen
I have a user called bypass whose defined shell in /etc/passwd is /Path/To/bypass.sh that script takes three parameters. When I run the script from the command line the script identifies the parameters. However, when the script is run via an ssh command (i.e. ssh byp...@10.1.1.1 Parm1 Parm2 Par

Re: Kernel question - what happens when a shell script is the interpreter for another shell script?

2008-03-23 Thread Shachar Shemesh
Dan Kenigsberg wrote: I happenned to stumble on this question recently. prctl(2) has PR_SET_NAME. An even simpler solution, that may work on non-Linux too and may be good enough, is softlink. From the prctl man page: CONFORMING TO This call is Linux-specific. IRIX has a prctl() s

Re: Kernel question - what happens when a shell script is the interpreter for another shell script?

2008-03-23 Thread Dan Kenigsberg
an's email I tried running the set with strace, and realized it > was, indeed, a user space thing. As I need that for a (user space) > program that intercepts the actual kernel calls (and sometimes emulates > them), I will assume that the governing rule is that a program can have >

Re: Kernel question - what happens when a shell script is the interpreter for another shell script?

2008-03-20 Thread Yedidyah Bar-David
On Thu, Mar 20, 2008 at 07:25:19PM +0200, Shachar Shemesh wrote: > And now to a slightly related subject - does anyone know how I can > change the command line that appears in "ps" for a program after it has > been run? I know it should be possible, because I vaguely remember > programs that rec

Re: Kernel question - what happens when a shell script is the interpreter for another shell script?

2008-03-20 Thread Shachar Shemesh
ernel calls (and sometimes emulates them), I will assume that the governing rule is that a program can have just one shell script in its interpreter path. And now to a slightly related subject - does anyone know how I can change the command line that appears in "ps" for a program afte

Re: Kernel question - what happens when a shell script is the interpreter for another shell script?

2008-03-20 Thread Valery Reznic
rong place. I got as far as the > function "load_script" > (fs/binfmt_script.c line 18 in the 2.6.23 kernel > code), which seems to > go over the file, extract the interpreter, and > restart the entire > process. Of course, once the process has restarted, > bprm->s

Re: Kernel question - what happens when a shell script is the interpreter for another shell script?

2008-03-20 Thread Matan Ziv-Av
On Thu, 20 Mar 2008, Shachar Shemesh wrote: Hi all, I tried the following experiment. /tmp/file1 (marked executable) has the following content: #!/bin/date echo "$@" /tmp/file2 has the following content: #!/tmp/file1 echo "File2" when I run file2, I expect it to print out the current

Re: Kernel question - what happens when a shell script is the interpreter for another shell script?

2008-03-20 Thread Omer Zak
Did you add /tmp/file1 to the list in /etc/shells? On Thu, 2008-03-20 at 16:23 +0200, Shachar Shemesh wrote: > Hi all, > > > I tried the following experiment. /tmp/file1 (marked executable) has the > following content: > > #!/bin/date > > > echo "$@" > > > /tmp/file2 has the following conte

Kernel question - what happens when a shell script is the interpreter for another shell script?

2008-03-20 Thread Shachar Shemesh
r the file, extract the interpreter, and restart the entire process. Of course, once the process has restarted, bprm->sh_bang is not zero (line 25 of the file), and the function returns ENOEXEC. This explains why a shell script cannot be the interpreter for a shell script. What is not explaine

Re: Launching a shell script from a remote Windows machine.

2004-11-22 Thread Oleg Goldshmidt
Amir Hardon <[EMAIL PROTECTED]> writes: > I'm looking for a way to create a simple click-n'-forget icon on a > Windows(98) machine, that will invoke a shell script on a Linux > server. The only solution I can think of that doesn't involve > writing a client-ser

Re: Launching a shell script from a remote Windows machine.

2004-11-21 Thread Yaacov Fenster - System Engineering Troubleshooting and other stuff
Amir - Perhaps you might want to use the "magic scripts" in a Samba server (http://www.oreilly.com/catalog/samba/chapter/book/ch08_02.html ) Amir Hardon wrote: I'm looking for a way to create a simple click-n'-forget icon on a Windows(98) machine, that will invoke a she

Re: Launching a shell script from a remote Windows machine.

2004-11-21 Thread amos
Amir Hardon wrote: I'm looking for a way to create a simple click-n'-forget icon on a Windows(98) machine, that will invoke a shell script on a Linux server. The only solution I can think of that doesn't involve writing a client-server application specific for this task, is using

Re: Launching a shell script from a remote Windows machine.

2004-11-21 Thread Yedidyah Bar-David
On Sun, Nov 21, 2004 at 08:41:48PM +0200, Amir Hardon wrote: > I'm looking for a way to create a simple click-n'-forget icon on a Windows(98) > machine, that will invoke a shell script on a Linux server. > The only solution I can think of that doesn't involve writing a clie

Launching a shell script from a remote Windows machine.

2004-11-21 Thread Amir Hardon
I'm looking for a way to create a simple click-n'-forget icon on a Windows(98) machine, that will invoke a shell script on a Linux server. The only solution I can think of that doesn't involve writing a client-server application specific for this task, is using ssh+putty, bu

Re: Help with a Bourne Shell Script

2002-09-25 Thread Shlomi Fish
On Wed, 25 Sep 2002, Nadav Har'El wrote: > On Wed, Sep 25, 2002, Shlomi Fish wrote about "Re: Help with a Bourne Shell Script": > > Sometimes I do "expr 5 \> 6 > /dev/null" instead. > > Well, you shouldn't... Expr wasn't meant for these ki

Re: Help with a Bourne Shell Script

2002-09-25 Thread Nadav Har'El
On Wed, Sep 25, 2002, Shlomi Fish wrote about "Re: Help with a Bourne Shell Script": > Sometimes I do "expr 5 \> 6 > /dev/null" instead. Well, you shouldn't... Expr wasn't meant for these kinds of things, and you just saw how this can cause you bugs. Do &q

Re: Help with a Bourne Shell Script

2002-09-25 Thread Shlomi Fish
On Wed, 25 Sep 2002, Nadav Har'El wrote: > On Wed, Sep 25, 2002, Shlomi Fish wrote about "Help with a Bourne Shell Script": > > http://t2.technion.ac.il/~shlomif/fetchweb > > My problem is that proc_args does not return the new command line. > > That'

Re: Help with a Bourne Shell Script

2002-09-25 Thread Nadav Har'El
On Wed, Sep 25, 2002, Shlomi Fish wrote about "Help with a Bourne Shell Script": > http://t2.technion.ac.il/~shlomif/fetchweb > My problem is that proc_args does not return the new command line. That's because parse_args returned "0\n0\nyour arguments" instead of

Re: Help with a Bourne Shell Script

2002-09-25 Thread Yedidyah Bar-David
On Wed, Sep 25, 2002 at 09:56:34AM +0300, Shlomi Fish wrote: > > Check: > > http://t2.technion.ac.il/~shlomif/fetchweb > > My problem is that proc_args does not return the new command line. You probably meant 'test' and not expr in line 54. expr, besides setting the return value, also outputs

Help with a Bourne Shell Script

2002-09-24 Thread Shlomi Fish
Check: http://t2.technion.ac.il/~shlomif/fetchweb My problem is that proc_args does not return the new command line. Regards, Shlomi Fish -- Shlomi Fish[EMAIL PROTECTED] Home Page: http://t2.technio

Re: Is apropos a shell script on your (non Debian) machine?

2000-07-08 Thread Henry Ficher
On Sat, 8 Jul 2000, Shaul Karl wrote: > The TkMan Makefile claims that with Linux apropos is a shell script. > This is not the case with my Debian Linux. > I tend to think that it is also an ELF executable on other distros. > Before mailing the author about it I would like to veri

Re: Is apropos a shell script on your (non Debian) machine?

2000-07-08 Thread Gaal Yahas
On Sat, Jul 08, 2000 at 11:40:48AM +0300, Shaul Karl wrote: > The TkMan Makefile claims that with Linux apropos is a shell script. > This is not the case with my Debian Linux. > I tend to think that it is also an ELF executable on other distros. > Before mailing the author about it

Is apropos a shell script on your (non Debian) machine?

2000-07-08 Thread Shaul Karl
The TkMan Makefile claims that with Linux apropos is a shell script. This is not the case with my Debian Linux. I tend to think that it is also an ELF executable on other distros. Before mailing the author about it I would like to verify that. Can you check it on your non Debian distros and let

Re: shell script

1999-04-11 Thread Nir Soffer
On Sun, 11 Apr 1999, Peter L. Peres wrote: > >MYVARIABLE=`telnet some.host.name 1234 | grep "the interesting line" | ..` > > With current bash/telnet this does not work as expected. Telnet chokes if > its stdin is not a tty. Ihad to do things like `yes|telnet somewhere|...`. Just use netcat th

Re: shell script

1999-04-11 Thread Adam Morrison
"Peter L. Peres" wrote: > >MYVARIABLE=`telnet some.host.name 1234 | grep "the interesting line" | ..` > > With current bash/telnet this does not work as expected. Telnet chokes if > its stdin is not a tty. I had to do things like `yes|telnet somewhere|...`. http://pobox.com/~djb/software/ptyge

Re: shell script

1999-04-11 Thread Peter L. Peres
On Sat, 10 Apr 1999, guy keren wrote: >On Thu, 8 Apr 1999, Alex Shnitman wrote: > >> > Does anyone know how to connect to a remote host by telnet using a shell >> > script ? >> > I need to get some data using a telnet. >> >> man expect >>

Re: shell script

1999-04-10 Thread Gaal Yahas
On Thu, Apr 08, 1999 at 08:56:18PM +0300, I wrote: > > Does anyone know how to connect to a remote host by telnet using a shell > > script ? > > I need to get some data using a telnet. > > % perl -pe 'sleep 2' < data-file | telnet host Oh, and, of course,

Re: shell script

1999-04-09 Thread guy keren
On Thu, 8 Apr 1999, Alex Shnitman wrote: > > Does anyone know how to connect to a remote host by telnet using a shell > > script ? > > I need to get some data using a telnet. > > man expect > Should get you started in 15 minutes. actually, you're throwing in

Re: shell script

1999-04-08 Thread Gaal Yahas
On Thu, Apr 08, 1999 at 02:37:20PM +0300, Mike wrote: > Hi all > Does anyone know how to connect to a remote host by telnet using a shell > script ? > I need to get some data using a telnet. Everybody's gonna laugh, but here's a quick'n'dirty way: % cat>

Re: shell script

1999-04-08 Thread Peter L. Peres
On Thu, 8 Apr 1999, Mike wrote: >Hi all >Does anyone know how to connect to a remote host by telnet using a shell >script ? >I need to get some data using a telnet. Check out expect and xt. Peter

Re: shell script

1999-04-08 Thread Ariel Biener
On Thu, 8 Apr 1999, Mike wrote: Use expect --Ariel > Hi all > Does anyone know how to connect to a remote host by telnet using a shell > script ? > I need to get some data using a telnet. > > T

Re: shell script

1999-04-08 Thread Alex Shnitman
Mike writes: > Does anyone know how to connect to a remote host by telnet using a shell > script ? > I need to get some data using a telnet. man expect Should get you started in 15 minutes. -- Alex Shnitman| http://www.debian.org [EMAIL PROTECTED

shell script

1999-04-08 Thread Mike
Hi all Does anyone know how to connect to a remote host by telnet using a shell script ? I need to get some data using a telnet. Thank you Mike