10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I have the following script that just archives and clears some log files.
#!/bin/bash
# script: archive_logs_and_clear
# add date to logfile names and copy archive directory
# clear logs
# change to script directory
cd ... (4 Replies)
Discussion started by: LMHmedchem
4 Replies
2. Shell Programming and Scripting
Hi,
I am running below script using autosys.
Though the script is running fine, it fails the workflow but the autosys job shows success.
Can you please let me know where can i make change to script:-
#!/bin/ksh
#to test mail from directory
set -x
frequency=$1
param_file=/local/test... (4 Replies)
Discussion started by: rajrishi990
4 Replies
3. Shell Programming and Scripting
I developed a script to group by 1st column and sum few of the column which are required, but while executing sum of 2nd column which has decimals in place is not getting correct sum. below is the script
awk -F, '{a+=$2;b+=$33;c+=$58;d+=$11;e+=$50;}END{for(i in a)printf... (2 Replies)
Discussion started by: rramkrishnas
2 Replies
4. Shell Programming and Scripting
I am trying to run a script which ftp the files from one server to another.
Below is the script -
#!/bin/bash
echo "Please enter no : "
read variable
echo "You entered: $input_variable"
host=xxxxx
USER=xxx
PASSWORD=xxx
ftp -inv $HOST <<EOF
user $USER $PASSWORD
cd... (4 Replies)
Discussion started by: chandraprakash
4 Replies
5. Shell Programming and Scripting
Hi,
I have a script which when i run in manually it runs properly, but when i run the same script using UC4 scheduler it dose not run properly.
Below is the code i am using. i am not sure what is happening when i run this through UC4 the files are not generated. but when i run this manually it... (1 Reply)
Discussion started by: Mohammed_Tabish
1 Replies
6. Shell Programming and Scripting
Hi Folks,
I am going through a sample script which is not working.
Also i want to understand the certain syntaxes
#!/bin/sh
clear
x="y"
echo "enter ur 1st no."
read n1
echo "enter ur 2nd no."
read n2
while
do
clear
echo "1.sum"
echo "2.subtraction"
echo "3.product"... (3 Replies)
Discussion started by: rafa_fed2
3 Replies
7. Shell Programming and Scripting
#!/bin/bash
###########################################
ADMIN="usera@mblonline.com"
AMQ="userb@mblonline.com"
SUBJECT="Remote Shutdown Client Status"
MAIL="/bin/mail"
###########################################
DAT=`date '+%d-%b-%Y'`
PLUGIN="/usr/lib/nagios/plugins/check_nrpe"
PORT="5666"... (2 Replies)
Discussion started by: telnor
2 Replies
8. Shell Programming and Scripting
Hello All,
I am ruuning the below script.
userchecking.sh
###########################
#! /bin/ksh
NIS_SCRIPT_HOME="/mot/systems/NIS_SCRIPT_NEW"
. $NIS_SCRIPT_HOME/common.env
WORK_DIR="/mot/systems/scripts/"
#WORK_DIR="/mot/b36376/myscripts/nis_user_automation"... (1 Reply)
Discussion started by: ajaincv
1 Replies
9. Shell Programming and Scripting
#!/bin/ksh
set -x
SQLSTR="LOGIN/PASSWORD"
sqlplus -s ${SQLSTR} @<<EOF
set pagesize 0 feedback off verify off heading off echo off;
UPDATE TABLE NAME
SET VALUE = VALUE + 1
where VALUE2 = 'ABCDE';
exit;
COMMIT;
EOF
i am not able to update the column and not able to exit from sqlplus. ... (7 Replies)
Discussion started by: karthicss
7 Replies
10. Shell Programming and Scripting
I am working on a script that checks two arguments at the command line. The first argument is a search pattern, the second can be a file or a directory, if it is a file a second script is called that checks it for the search pattern. If the second argument is a directory, it checks for the search... (5 Replies)
Discussion started by: Breakology
5 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)