10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to make a config file which contain all the paths.
i want to read the config file line by line and pass as an argument on my below function.
Replace all the path with reading config path line by line and pass in respective functions.
how can i achieve that?
... (6 Replies)
Discussion started by: sadique.manzar
2. Shell Programming and Scripting
The file starts like this:
Directory: <path to the script>
Script: <script fife name>
What is the use of the first two lines in the script? What if I save the file without them? What will be the effect? They are not comments. Im very new to this,... (4 Replies)
Discussion started by: remytom
3. Shell Programming and Scripting
Hi Team -
I"m very new to Shell Scripting so I have a rather novice question. My forte is Windows Batch Scripting so I was just wondering what the Shell Script equivalent is to the DOS command %~n?
%~n is a DOS variable that dispayed the script name.
For instance (in DOS):
REM... (11 Replies)
Discussion started by: SIMMS7400
4. Shell Programming and Scripting
I've 2 shell scripts viz., CmnFuncs.ksh and myScript.ksh.
1st script contains all common functions and its code is as below:
export Rundt=`date +%Y%m%d`
2nd script is invoking the above one and I expect to use the RunDt variable... (8 Replies)
Discussion started by: njny
5. Shell Programming and Scripting
i am trying to do this
bash> cat abc.sh
so it is giving me write simply i created a func and it worked
now i modified it like this way
bash> cat abc.sh (2 Replies)
Discussion started by: aishsimplesweet
6. Red Hat
please help me in this script
shell script :1
echo "this is first file"
d=13 (2 Replies)
Discussion started by: ponmuthu
7. Shell Programming and Scripting
Can you please debug, what's wrong with the below code.
I am gettng unexpected token error
#Changing the directory to data directory where the pf exists.
#Listing the names of the Pricefiles for rebuilding
echo "The following pricefiles will... (6 Replies)
Discussion started by: sdosanjh
8. Shell Programming and Scripting
This is my function which is creating three variables based on counter & writing these variable to database by calling another function writeRecord
but only one record is getting wrote in DB.... Please advise ASAP...:confused:
echo "Saurabh is GREAT $#"
let... (2 Replies)
Discussion started by: omkar.sonawane
9. Shell Programming and Scripting
I have tried to put a exit 0 statement within a function I have created in the shell script but it doesn't seem to exit out of the script? Can someone tell me why? And is there any other way to exit out of the script from within a function?
Thanks! (1 Reply)
Discussion started by: nvrh7
10. Shell Programming and Scripting
Let say there is a module fileselection module written in c language which returns the file name. Is it possible to get the file name from the file selection module directly, I mean can we call a c function directly in shell script without doing executable. If possible then how it can be... (1 Reply)
Discussion started by: surjyap
exit(1) User Commands exit(1)
exit, return, goto - shell built-in functions to enable the execution of the shell to advance beyond its sequence of steps
exit [ ( expr )]
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-
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
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.
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
See attributes(5) for descriptions of the following attributes:
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|Availability |SUNWcsu |
break(1), csh(1), ksh(1), sh(1), attributes(5)
SunOS 5.10 15 Apr 1994 exit(1)