Let's look at just three commands in this script:
The first command in this list sets the variable PID to the exit status of the previous command (echo "$line") which is almost always going to be 0. The second command causes the script to wait for about 2 seconds. Then the third command (after parameter expansion) is:
This is a request to terminate all processes in the current process group. On most systems, killing all processes in the current process group includes killing the shell that is running this script.
I hope someone can shed any light on this mystery.
I am trying to run the following command:
su userID -c
remsh server -l userid -n "awk -F^ '\$4 == \"SMITH\"' /tmp/infromational/version74b/LIVE/TEMPORARY/ABCfiles/HLC_Database_File.bat|head -1" > /tmp/variant/45BV32/var/store13.logfnd
I... (15 Replies)
Hi All,
I have list of 100 table names in a file, how to read table name from and pass to DB2 export command and run for all tables in loop.
Please help me with script.
db2 EXPORT TO ~/data_export/<table name from file>.ixf OF IXF MESSAGES messages.txt "SELECT * FROM ITG.<Table Name... (4 Replies)
Hi everyone,
when executing this command in unix:
echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error.
here is content of my script:
tdbsrvr$ vi hc.sh
"hc.sh" 22 lines, 509... (4 Replies)
Hey, I am trying to write a script that will open all of my session windows, and then secure shell into the appropriate server in the new windows. Seems simple, but I cant get it to work! Please help! :confused: (1 Reply)
Hi,
Not sure what the issue is here, but when i run the script. A simple copy command, it does not find the cp command ? See scrpt below :
#!/bin/sh
set -x
#############################################
# Backup Processes #... (4 Replies)
The command is:
sic -h irc.freenode.net 2>&1 | tee -a irc.log
Where sic is an IRC client, and I'm piping the output to tee in order to log my IRC sessions.
I'm trying to handle reconnects by running it in a while loop in the shell process and cat the initial commands into sic's stdin.
I... (1 Reply)
Dear All,
Writing a script in which I want to run a command in background and keep it running even script is finished.
I have tried like below,
`truss -p <pid> >> & /tmp/log &`
But doesnt work.. script goes running and nothing in log file. (7 Replies)
Hi,
I have run a lot of commands one after one,
but I can't run them simultaneous.
One command has to run and when finished second command has to run etc.
Also I would like to save all the outputs created by the commands in a file.
The commands can sometimes take hours, so it is also... (10 Replies)
hello
i have write a script which can create username + password
#!/bin/bash
# Script to add a user to Linux system
if ; then
read -p "Enter username : " username
read -s -p "Enter password : " password
egrep "^$username" /etc/passwd >/dev/null
if ; then... (3 Replies)
Dear folks
I have two data set which there names are "final.map" and "1.geno" and look like this structures:
final.map:
gi|358485511|ref|NC_006088.3| 2044
gi|358485511|ref|NC_006088.3| 2048
gi|358485511|ref|NC_006088.3| 2187
gi|358485511|ref|NC_006088.3| 17654
... (2 Replies)
Discussion started by: sajmar
2 Replies
LEARN ABOUT OSF1
sleep
sleep(1) General Commands Manual sleep(1)NAME
sleep - Suspends execution for at least the specified time
SYNOPSIS
sleep seconds
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
sleep: XCU5.0
Refer to the standards(5) reference page for more information about industry standards and associated tags.
OPTIONS
None
OPERANDS
Non-negative integer specifying the number of seconds for which execution is to be suspended.
DESCRIPTION
The sleep command suspends execution of a process for at least the interval specified by seconds, which can range from 0 to 2,147,483,647
seconds. Depending on system activity, the actual time of suspension may be longer. See the sleep(3) reference page.
[Tru64 UNIX] seconds can be entered as a non-negative decimal, octal, or hexadecimal value.
NOTES
If sleep receives a SIGALARM signal before process execution has resumed, sleep takes one of the following actions: Terminates normally
with a 0 (zero) exit status. (See the sleep(3) reference page for more information.) Ignores the signal Performs default processing
EXIT STATUS
The following exit values are returned: Execution was successfully suspended for at least the requested time, or a SIGALARM signal was
received. An error occurred.
EXAMPLES
To display a message at 4-minute intervals for 20 minutes, create a shell script called remind containing the following:
for i do sleep 240; echo $i sleep 240; echo $i sleep 240; echo $i sleep 240; echo $i sleep 240; echo $i done
To display the message Try calling NHK at 4-minute intervals, enter: remind 'Try calling NHK' To run a command at regular intervals,
create a shell script containing the following:
while true do
date
sleep 60 done
This displays the date and time once a minute. To execute a command after a specified interval, enter the following; (sleep 3600;
echo Time's up) &
This displays the message "Time's up" after one hour.
ENVIRONMENT VARIABLES
The following environment variables affect the execution of sleep: Provides a default value for the internationalization variables that are
unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization vari-
ables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value,
overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes
of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). Determines the locale for the for-
mat and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of
LC_MESSAGES.
SEE ALSO
Commands: wait(1)
Functions: alarm(3), pause(3), sigaction(2), sleep(3)
Standards: standards(5)sleep(1)