12-23-2009
communication
hi.. I am sorry for confusing you on this.Trust me, i am just a beginner in shell scripting. I was merely trying to create a file containing all the commands and the outputs that the user tries on the shell and save it with the filename of the output of the date command modified with the sed command. Thats why i used sed command to create the filename and $name1 will contain the output of the date command after filtered.
But finally made a mistake in the $0 line of the command as u rightly pointed out.
But, is there a way that we can send a number as an exit status to the parent process and the latter then determines the next action to be carried out.If yes, whats the command?
Thanks in advance.
Last edited by bdiwakarteja; 12-23-2009 at 02:36 PM..
Reason: corrections
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi everybody,
I have a speech recognition application which works on windows and which create a text file.
My main application works on unix and I need to get (or simply read) in real time the text file.
I can't use a soft like Samba because it is not authorized in my company.
I would like a... (1 Reply)
Discussion started by: kintoo
1 Replies
2. UNIX for Advanced & Expert Users
Hi,
I am working on serial communication on Unix. Can anyone guide me through it. The steps required for RS 232 communication and can i do serial communication even if i dont have super user previledges.
Thankx,
Vicky (1 Reply)
Discussion started by: Vicky
1 Replies
3. UNIX for Dummies Questions & Answers
Hi All
I am using a QTP testing tool which is in windows and
I need to connect to a unix machine from the windows and execute a shell script which will throw some log files and i need to open one log file and get a number (no. of records) and use it in my Testing tool script which is in... (3 Replies)
Discussion started by: arulraj2007
3 Replies
4. Shell Programming and Scripting
Hi guys,
I am new to Unix shell scripting. Can anyone of you tell me how to kill all the processes at a time for a particular user?(No listing the process ID of each process in the kill -9 command).
Thanks in Advance,
-Hary (5 Replies)
Discussion started by: tadi18
5 Replies
5. UNIX for Dummies Questions & Answers
hey,
I know that there are bash commands like top or ps that allow me to monitor processes. But how can i monitor 1 process and log the output in a file?
thx in advance
Stephane Rufer (3 Replies)
Discussion started by: rufman
3 Replies
6. UNIX for Advanced & Expert Users
hello everybody and a happy new year!
i am trying the client-server model...i have no problem with sockets etc...
especially for server:there is a father who is listening for TCP connections from clients,the later send commands which parent shares to his children.
then children execute... (1 Reply)
Discussion started by: vaggelakis
1 Replies
7. Shell Programming and Scripting
Hi All,
I need to come up with a shell script that logs into a windows system and fires a batch/executable file in it.
Any idea how to go about doing this?
Please help.
Regards,
Agniv. (4 Replies)
Discussion started by: agnivaccent
4 Replies
8. Shell Programming and Scripting
I had issues with processes locking up. This script checks for processes and kills them if they are older than a certain time.
Its uses some functions you'll need to define or remove, like slog() which I use for logging, and is_running() which checks if this script is already running so you can... (0 Replies)
Discussion started by: sukerman
0 Replies
9. UNIX for Dummies Questions & Answers
I am trying to play and create processes and found this piece of code....
int myMain(int argc , char* argv){
childID = 0;
for (j=1;j<3;j++)
if (childID = fork())
break;
fprintf(stderr, " process ID:%d parent ID:%d child ID:%d\n", getpid(), getppid(), childID);
return... (3 Replies)
Discussion started by: joker40
3 Replies
10. Shell Programming and Scripting
Hi,
I have three files in my IN directory.Each file should be copied 25 times using for loop.Each file processing should run in parallel?How to spawn multiple processes in unix?Any help would be appreciated.
Thanks,
Liyakath (7 Replies)
Discussion started by: liyakathali
7 Replies
exit(1) User Commands exit(1)
NAME
exit, return, goto - shell built-in functions to enable the execution of the shell to advance beyond its sequence of steps
SYNOPSIS
sh
exit [n]
return [n]
csh
exit [ ( expr )]
goto label
ksh
*exit [n]
*return [n]
DESCRIPTION
sh
exit will cause the calling shell or shell script to exit with the exit status specified by n. If n is omitted the exit status is that of
the last command executed (an EOF will also cause the shell to exit.)
return causes a function to exit with the return value specified by n. If n is omitted, the return status is that of the last command exe-
cuted.
csh
exit will cause the calling shell or shell script to exit, either with the value of the status variable or with the value specified by the
expression expr.
The goto built-in uses a specified label as a search string amongst commands. The shell rewinds its input as much as possible and searches
for a line of the form label: possibly preceded by space or tab characters. Execution continues after the indicated line. It is an error to
jump to a label that occurs between a while or for built-in command and its corresponding end.
ksh
exit will cause the calling shell or shell script to exit with the exit status specified by n. The value will be the least significant 8
bits of the specified status. If n is omitted then the exit status is that of the last command executed. When exit occurs when executing
a trap, the last command refers to the command that executed before the trap was invoked. An end-of-file will also cause the shell to exit
except for a shell which has the ignoreeof option (See set below) turned on.
return causes a shell function or '.' script to return to the invoking script with the return status specified by n. The value will be the
least significant 8 bits of the specified status. If n is omitted then the return status is that of the last command executed. If return
is invoked while not in a function or a '.' script, then it is the same as an exit.
On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways:
1. Variable assignment lists preceding the command remain in effect when the command completes.
2. I/O redirections are processed after variable assignments.
3. Errors cause a script that contains them to abort.
4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a vari-
able assignment. This means that tilde substitution is performed after the = sign and word splitting and file name generation are not
performed.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO
break(1), csh(1), ksh(1), sh(1), attributes(5)
SunOS 5.10 15 Apr 1994 exit(1)