[newbie] Perl Script in Background
How do i tell a script (perl script) to start in the background and stay running? -Cody Harris ++ | Linux Rox My Sox! | | Check out HCHS! | | http://vectec.net | ++--+ | Proud to use Mandrake Linux 8.1 as a server. | | Not proud to use Windows as a primary server. | ++--+ | Registered Linux user #315598 | | Registered Linux Computer #200951 | | Wrote on a Windoze Computer :( | ++
Re: [newbie] Perl Script in Background
On Wed, 2003-05-28 at 10:40, Cody Harris wrote: How do i tell a script (perl script) to start in the background and stay running? -Cody Harris For instance: perl /usr/local/bin/rdf.pl -- Wed May 28 11:20:01 EST 2003 11:20:01 up 13:53, 3 users, load average: 0.32, 0.29, 0.29 - |____ |kuhn media australia| | /-oo /| |'-. |http://kma.0catch.com | | .\__/ || | | || | _ / `._ \|_|_.-' |stephen kuhn| | | / \__.`=._) (_ | email: [EMAIL PROTECTED] | - linux user #:267497 linux machine #:194239 * MDK 9.1 RH 7.3 Mandrake Linux Kernel 2.4.21-11mdk Cooker for i586 - * This message was composed on a 100% Microsoft free computer * Prof:So the American government went to IBM to come up with a data encryption standard and they came up with ... Student: EBCDIC! Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [newbie] Perl Script in Background
* Cody Harris [EMAIL PROTECTED] [030527 19:15]: How do i tell a script (perl script) to start in the background and stay running? If you are running it from the command line, put a space and an ampersand after the name of the Perl script, like: myscript -- Jan Wilson, SysAdmin _/*]; [EMAIL PROTECTED] Corozal Junior College | |:' corozal.com corozal.bz Corozal Town, Belize | /' chetumal.com linux.bz Reg. Linux user #151611 |_/ Network, PHP, Perl, HTML Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [newbie] Perl Script in Background
On Tuesday 27 May 2003 05:40 pm, Cody Harris wrote: How do i tell a script (perl script) to start in the background and stay running? At the command line, starting a file with a ending will make it run in background. As in ./setiathome . I hope that helps. -- Linux: For the people, by the people. Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
[newbie] Perl Script
Can somebody tell my why this doesn't work? #!/usr/bin/perl for($x = 1; $x 255; $x++) { snmpwalk 172.17.16.$x public; } Thanks Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [newbie] Perl Script
On Tue, 16 Jul 2002 17:33:38 -0400 Leonard W. Miller [EMAIL PROTECTED] wrote: Can somebody tell my why this doesn't work? #!/usr/bin/perl for($x = 1; $x 255; $x++) { snmpwalk 172.17.16.$x public; } Thanks I'm just learning perl myself, but, in order to make a system call in perl, you need to either do: 1. system(snmpwalk 172.17.16.$x public); or 2. $result = `snmpwalk 172.17.16.$x public`; Those are back ticks, not quotes by the way. $result is just the exit value of the program. Bill Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
[newbie] Perl script is not able to execute
Hi, I am using Mandrake 8.1 with bash shell. Today is my first time using perl script. I read from the book said if I add #!/usr/bin/perl to the first line of my perl script, I can execute the script by just typing the name of the script into the command line. I have set the permission of this test.pl to 777 However, when I did that, the shell gave me a error message said bash: test.pl: command not found If I type perl test.pl or /usr/bin/perl test.pl then the perl script will work perfectly Please help me! Daniel Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [newbie] Perl script is not able to execute
the directory containing perl was in your PATH variable while the current directory is not (its a security measure). the '#!' on the first line simply means that the file contains commands to be interpreted by the interpreter following these symbols (i think they are called magic numbers or something). whenever executing a script/executable in the current directory, make sure of the following * check the permissions, you should have read _and_ execute permissions. * if the current directory is not included in the PATH (type echo $PATH to check), prepend ./ to the script/executable name (e.g. ./test.pl) hth. On Wed, 30 Jan 2002 03:28:24 -0500 Daniel Chen [EMAIL PROTECTED] revealed these words to me: Hi, I am using Mandrake 8.1 with bash shell. Today is my first time using perl script. I read from the book said if I add #!/usr/bin/perl to the first line of my perl script, I can execute the script by just typing the name of the script into the command line. I have set the permission of this test.pl to 777 However, when I did that, the shell gave me a error message said bash: test.pl: command not found If I type perl test.pl or /usr/bin/perl test.pl then the perl script will work perfectly Please help me! Daniel -- Programming, an artform that fights back. = Anuerin G. Diaz Design Engineer Millennium Software, Incorporated 2305 B West Tower, Philippines Stocks Exchange Center, Exchange Road, Ortigas Center, Pasig City Tel# 638-3070 loc. 72 Fax# 638-3079 = Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
RE: [newbie] Perl script is not able to execute
./perl.pl You probably don't have the current directory in your search path, so when you issue the perl.pl command, the machine looks everywhere, apart from the current directory. Either get into the habit of specifying ./command or add ./ to your search path. Be aware that many people do not advocate adding ./ to your standard search path and would recommend you get into the habit of prepending ./ when necessary. -Original Message- From: Daniel Chen [SMTP:[EMAIL PROTECTED]] Sent: Wednesday, January 30, 2002 8:28 AM To: Linux newbie Subject:[newbie] Perl script is not able to execute Hi, I am using Mandrake 8.1 with bash shell. Today is my first time using perl script. I read from the book said if I add #!/usr/bin/perl to the first line of my perl script, I can execute the script by just typing the name of the script into the command line. I have set the permission of this test.pl to 777 However, when I did that, the shell gave me a error message said bash: test.pl: command not found If I type perl test.pl or /usr/bin/perl test.pl then the perl script will work perfectly Please help me! Daniel File: message.footer ** This email and any files sent with it are intended only for the named recipient. If you are not the named recipient please telephone/email the sender immediately. You should not disclose the content or take/retain/distribute any copies. ** Norwich Union Life Pensions Limited Registered Office 2 Rougier Street York YO90 1UU Registered in England Number 3253947 A member of the Norwich Union Marketing Group which is regulated by the Personal Investment Authority. Member of the Association of British Insurers. For further Enquires 01603 622200 Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [newbie] Perl script is not able to execute
On Wed, 30 Jan 2002 04:41:04 -0500 Daniel Chen [EMAIL PROTECTED] revealed these words to me: Hi, Thank you for quickly answer my question, but the problem still there! Now, the bash shell gave me another wrong message: bash: /usr/bin/test.pl: no such file or directory When I put ./test.pl, it shows: bash: /usr/bin/test.pl: bad interpreter: no such file or directory Please help me again, thank you! Daniel i have no knowledge of perl (although im planning to, it just keeps on getting on the backburner), but i think the problem is not directly perl related. i was able to simulate your output [adiaz@Ronin tmp]$ ./test.pl bash: ./test.pl: bad interpreter: No such file or directory and test.pl contained in its first line the entry (without the quotes) #!/usr/bin/test.pl but when i substitute this line #!/bin/perl i get this one [adiaz@Ronin tmp]$ ./test.pl syntax error at ./test.pl line 5, at EOF Execution of ./test.pl aborted due to compilation errors. [adiaz@Ronin tmp]$ hey, i told you i dont know perl ;-). but i think you get my point. ciao! -- Programming, an artform that fights back. = Anuerin G. Diaz Design Engineer Millennium Software, Incorporated 2305 B West Tower, Philippines Stocks Exchange Center, Exchange Road, Ortigas Center, Pasig City Tel# 638-3070 loc. 72 Fax# 638-3079 = Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [newbie] Perl script is not able to execute
On Thursday 31 January 2002 09:19, Anuerin G.Diaz wrote: [snip] and test.pl contained in its first line the entry (without the quotes) #!/usr/bin/test.pl but when i substitute this line #!/bin/perl This is the correct first line of a perl script if perl resides in /bin. The first line of a perl script needs to contain the location of the interpreter. i get this one [adiaz@Ronin tmp]$ ./test.pl syntax error at ./test.pl line 5, at EOF Execution of ./test.pl aborted due to compilation errors. I think you got this because there was no linefeed at the end of this first line. John Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [newbie] Perl script is not able to execute
On Wed, 30 Jan 2002 20:39:14 -0500 John Cichy [EMAIL PROTECTED] revealed these words to me: On Thursday 31 January 2002 09:19, Anuerin G.Diaz wrote: [snip] and test.pl contained in its first line the entry (without the quotes) #!/usr/bin/test.pl but when i substitute this line #!/bin/perl This is the correct first line of a perl script if perl resides in /bin. The first line of a perl script needs to contain the location of the interpreter. i get this one [adiaz@Ronin tmp]$ ./test.pl syntax error at ./test.pl line 5, at EOF Execution of ./test.pl aborted due to compilation errors. I think you got this because there was no linefeed at the end of this first line. John nope, i expected it not to compile because i know nothing about perl syntax. i just entered an echo statement (i guess perl has another syntax for echo, hehehehe) there hoping to invoke the perl interpreter. since the objective was to correctly call the perl interpreter and simulate the error messages of the original poster, i think the dummy script served its purpose. *grin* ciao! -- Programming, an artform that fights back. = Anuerin G. Diaz Design Engineer Millennium Software, Incorporated 2305 B West Tower, Philippines Stocks Exchange Center, Exchange Road, Ortigas Center, Pasig City Tel# 638-3070 loc. 72 Fax# 638-3079 = Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com