07-12-2010
yup, but is there a way to get a general commond/function execution status(returning number) withcout using $?
and btw, what if I use the dual square brackets, it only check if the returning value is null or non-null, rather than 0 or non-0.
So how should I get the $? directly in the if [[ ]] ?
Thank you all.
Last edited by biglau; 07-12-2010 at 04:40 AM..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have a file called get_columns.sh that I would like to replace $2 with $3. I have the following sed command written that works
sed s/'$3'/'$2'/g get_columns.sh > output.txt
However, when I try the command below, the file is empty.
sed s/'$3'/'$2'/g get_columns.sh > get_columns.sh
... (2 Replies)
Discussion started by: djschmitt
2 Replies
2. UNIX for Advanced & Expert Users
I am looking for all the header files (*.h).. which as per documentation of the UNIX system shouldbe there.
I am using
find / -name *.h -print
But it does't give anything.
My question is under what condition the "find" condition will fail to find the file?
What is the work around.
... (4 Replies)
Discussion started by: rraajjiibb
4 Replies
3. Shell Programming and Scripting
Below is a chuck of a shell script I have written. The problem I am having is with the test section. I want to test the status of the f60gen command but since I'm running the output of the f60gen command into tee, the test command is actually testing "tee" and not "f60gen". Is there a way to... (5 Replies)
Discussion started by: goswell
5 Replies
4. UNIX for Advanced & Expert Users
Hello all,
I develop an ERP application that runs on a number of *nix flavors. This application had been around for quite a number of years.
As part of the application launch, we do a check for a background process using the following command:
ps -ef | grep -v grep | grep mi\/ba | grep... (6 Replies)
Discussion started by: jlitzie
6 Replies
5. UNIX for Dummies Questions & Answers
Hi
i have done a copy operation (Storing one content of a file to another)
For example :
cp Fileone Filetwo
Now is it possible to know the status of the execution of that command ??
Without manually checking the Filetwo contents ??
Thanks in advance . (5 Replies)
Discussion started by: Ravi Pavanv
5 Replies
6. Shell Programming and Scripting
Hi
there is below code in my code , i did not understand what does it mean
RC=0
RC=$(( RC | $? ))
Please help me regarding this
---------- Post updated at 02:22 AM ---------- Previous update was at 01:46 AM ----------
Below is more example of the code (2 Replies)
Discussion started by: aishsimplesweet
2 Replies
7. UNIX for Advanced & Expert Users
Hi,
Want to log the output of command & check the exit status to find whether it succeeded or failed.
> ls abc
ls: abc: No such file or directory
> echo $?
1
> ls abc 2>&1 | tee log
ls: abc: No such file or directory
> echo $?
0
Tee commands changes my exit status to be always... (7 Replies)
Discussion started by: vibhor_agarwali
7 Replies
8. UNIX for Dummies Questions & Answers
would like to remove the post (8 Replies)
Discussion started by: vk39221
8 Replies
9. Shell Programming and Scripting
Hi All,
I am doing an export and import (datapump) of 4 schema. I know we can do an export of 4 schema in one command. But just want to know how to check the exit status if i do the export/import of 4 schema in different commands in background. Please suggest.
Thanks,
Mani (1 Reply)
Discussion started by: pvmanikandan
1 Replies
10. Red Hat
Hi All,
I am using RHEL 6 linux in my lab server and I am new to RHEL6 features.
lab1:root> uname -a
Linux lab1 2.6.32-358.18.1.el6.x86_64 #1 SMP Fri Aug 2 17:04:38 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux
I am facing a peculiar issue in my lab machine. When I connected via Opsware Global... (0 Replies)
Discussion started by: go2suresh1979
0 Replies