exit ststus 9 from perl system command

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting exit ststus 9 from perl system command
# 1  
Old 09-18-2009
Question exit ststus 9 from perl system command

HI all,

can anyone tell me what does exit status 9 from perl's system function meant.

I am using system fuction to execute a shell script as :

my $s=system ('script.sh' ,arg1 ,arg2);

print $s;

the output is 9.

Thanks in advance. !!Smilie
# 2  
Old 09-18-2009
Quoth perldoc -f system:
The return value is the exit status of the program as returned by the "wait" call. To get the actual exit value, shift right by eight (see below). See also "exec". This is not what you want to use to capture the output from a command, for that you should use merely backticks or "qx//", as described in "`STRING`" in perlop. Return value of -1 indicates a failure to start the program or an error of the wait(2) system call (inspect $! for the reason).
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Exit() system call verses process signals

Hello and thanks in advance for any help anyone can offer me I've been reading up on process signal calls (sighup, sigint, sigkill & sigterm) and I understand they all have different methods of terminating a running process. From what I've also read is a exit() actually terminates a process. ... (2 Replies)
Discussion started by: bodisha
2 Replies

2. Shell Programming and Scripting

How to call the System command twice in the same perl script...

Hello experts, I have a perl script which looks for the ARGV and then loads the data as per it. Example. #Checking the server to connect if ($ARGV eq 'QA') { $ENV{"ORACLE_HOME"} = "/oracle/product/11.2.0"; $ENV{"PATH"} = "$ENV{'PATH'}:/oracle/product/11.2.0/bin"; ... (1 Reply)
Discussion started by: msrahman
1 Replies

3. AIX

How to exit system console from HMC?

Hi, I ssh to HMC, then vtmenu, then start a system console from there. How do I exit the console to return to HMC prompt? I've tried the following two key combinations but none of them is working: (1) ~~ (2) Ctrl+[, Shift+( Thank you in advance! (4 Replies)
Discussion started by: aixlover
4 Replies

4. Shell Programming and Scripting

perl: looping through the output of a 'system' command

Hi there could anybody point me in the right direction when it comes to looping through the output of a system command in perl (i.e. df -k) doing a test against each line to see if it matches? for example if i have a df -k output like this and I wanted to grab the lines that matched "sda" or... (3 Replies)
Discussion started by: rethink
3 Replies

5. Shell Programming and Scripting

file handling in perl without using system command

Hi , Is there any way to achieve following using perl program (i.e without using system command). 1.system ("echo 'test' > /usr/spool/ship.csv"); 2.system ("cat /usr/ajay_test* >> /usr/spool/RAM/work/patil.csv"); 3.system("> /usr/spool/ajay.txt"); e.g for system("rm -f... (1 Reply)
Discussion started by: ajaypatil_am
1 Replies

6. Shell Programming and Scripting

Run system command in perl cgi

Hi guys, got a problem with a perl cgi script over here. I need it to run a system command to get the status of a process. Unfortunately the process is owned by a specific user and only this user can get its status. So i tried running the command from the perl cgi with "su", but then i get the... (12 Replies)
Discussion started by: polki
12 Replies

7. Shell Programming and Scripting

Perl System command calls to variable

I am new to scripting in Perl so I have a dumb question. I know I can call system commands using system("date"); But I am not able to: 1. set its output to a variable 2. run in quiet mode(no output to the screen) The examples i have #!/usr/bin/perl print `date +\%y\%m\%d.\%H\%M`;... (5 Replies)
Discussion started by: 4scriptmoni
5 Replies

8. Shell Programming and Scripting

Need Help w/PERL system command

Hi, I'm wanting to run an nslookup, dig or whatever to check for the existence of a printer. The PERL script will display the results on the screen, but I can't figure out how to capture the result & test the value. Any ideas will be greatly appreciated!!! Thank You (1 Reply)
Discussion started by: lorik
1 Replies

9. Shell Programming and Scripting

perl - system command

Can this be done without using te system command? I have a directory with a large number of files in it, but I am interested in only the 8 most recent. The directory looks like -rw-rw-rw- 1 adsm adsm 13412 Sep 22 08:31 events_dump_09222005.csv.gz -rw-rw-rw- 1 adsm adsm ... (5 Replies)
Discussion started by: reggiej
5 Replies

10. Shell Programming and Scripting

Perl run system command

Can perl execute a system command similar to the C function System()? Thanks. Gregg (1 Reply)
Discussion started by: gdboling
1 Replies
Login or Register to Ask a Question