08-05-2007
You need to use ksh for my script. My sure the first line is as I have it and make the script executable. Then even if you run it from csh, ksh will run my script.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Can someone help me with a Unix or perl script to convert the unix timestamps to human readable format?
Any help will be highly appreciated... (3 Replies)
Discussion started by: hamsasal
3 Replies
2. UNIX for Dummies Questions & Answers
I have a requirement to find the time difference in second between 2 given time stamps. An example scenario is shown below:
30 Oct 11:42:29:992 DEBUG org.apache.commons.digester.Digester - New match='form-validation/global/validator' (IID=, TID=)
30 Oct 11:42:29:993 DEBUG... (0 Replies)
Discussion started by: Alecs
0 Replies
3. Shell Programming and Scripting
Hello!
I have the following problem.
I read a file using perl, each line of this file has the fllowing format.
14/4/2008 8:42:03 πμ|10800|306973223399|4917622951117|1||1259|1|126|492|433||19774859454$
Th first field is the timestamp and the second field is the offset in seconds.
How can... (1 Reply)
Discussion started by: chriss_58
1 Replies
4. Shell Programming and Scripting
There was this thread earlier with the same name and the solution provided was excellent. Here is the solution to find diffrenc between two timestamp
$ cat timestamp
#! /usr/bin/ksh
echo enter first time stamp
read TIME1
echo enter second time stamp
read TIME2
H1=${TIME1%:+()}... (3 Replies)
Discussion started by: Shellslave
3 Replies
5. AIX
HI All,
can some one please help me how to fine the difference between two time stamps say
a= Nov 10, 2009 9:21:25 AM
b= Nov 10, 2009 10:21:25 AM
I want to find difference between the a & b
I googled and tried with some options but no luck.
My OS is AIX (1 Reply)
Discussion started by: bandlan9
1 Replies
6. UNIX for Dummies Questions & Answers
Hi,
i have current timestamp, lets say "12:02:45" in an variable (var1) and another timestamp "08:30:00" fetched from table in another variable2 (var2).
How do i compare 2 timestamps in unix shell scripting.
if var 1 > var 2 then echo message.
Thanks in advance. (3 Replies)
Discussion started by: prasannarajesh
3 Replies
7. Shell Programming and Scripting
Hi all!!,
I'm using Ksh and working on Linux.
I want to compare two timestamps, timestamp1 and timestamp2.
Until, timestamp1 is lesser than timestamp2, i want to do something, lets say print something.
The code i have written is:
a=`date +%H:%M:%S`
b=`date +%H:%M:%S -d" 1... (1 Reply)
Discussion started by: Jayaraman
1 Replies
8. Shell Programming and Scripting
Hi Friends,
Require a quick help to write the difference between 2 timestamps based on a unique column value:
Input file:
08/23/2012 12:36:09,JOB_5340,08/23/2012 12:36:14,JOB_5340
08/23/2012 12:36:22,JOB_5350,08/23/2012 12:36:26,JOB_5350
08/23/2012 13:08:51,JOB_5360,08/23/2012... (4 Replies)
Discussion started by: asnandhakumar
4 Replies
9. Shell Programming and Scripting
Legends,
I have a requirement to run the script exactly after one hour of completion of dependent script.
Eg: Script B should run after one hour on the completion of Script A.
I got the time stamps using following variables. these scripts runs in autosys
> DATE=`date +%H:%M`
>... (4 Replies)
Discussion started by: sdosanjh
4 Replies
10. Shell Programming and Scripting
hello
i'm using SOX to generate a spectrogram from a wave file with the command :
#sox file.wav -n spectrogram
is there a way to create a spectrogram using the same command but reading file timestamps instead of the namefile.wav , since name is changing every 4 hours? (it's saved with... (2 Replies)
Discussion started by: Board27
2 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)