AIX 4.3.3
I am trying to write a signal handler into a ksh shell script. I would like to capture the SIGTERM, SIGINT, and the SIGTSTP signals, print out a message to the terminal, and continue executing the script. I have found a way to block the signals:
#! /bin/ksh
SIGTERM=15
SIGINT=2... (2 Replies)
How to stop the Prstat using shell script ?
because after i run the below script the thing seems to be always in loop and cannot get out till i ctrl + c, is there anything that i can add in the script to make it terminate ?
<code>
#!/bin/sh
prstat -Tc -u testing > testing.txt
</code>
... (19 Replies)
Hi,
I am writing a bash shell script. How can I tell it to stop. For example, I would like to have something similar to the following:
mike=1
if ; then
STOP THE SCRIPT
fi (3 Replies)
Script_A.sh has
echo "In am in script A"
ksh ## K-shell is invoked.
Script B.sh ## which I am writing...
./script_A.sh
echo "I am in script B"
return 0
When I run:
$> Script_B.sh
$> I am in script A
$>
Basically, on calling Script_A.sh from within Script_B.sh I have the issue of... (2 Replies)
Hi All,
I would like to develop a shell script for stop & start an application server (1-4) on Solaris box. Here are the user requirements for this task.
1. User will input the option which server they wish to stop.
2. Will clear cache files from specific location.
3. ... (1 Reply)
Hi guys, I've found two nifty little scripts on these forums one which detects if the F5 key has been pressed:
#/bin/sh
_key()
{
local kp
ESC=$'\e'
_KEY=
read -d '' -sn1 _KEY
case $_KEY in
"$ESC")
while read -d '' -sn1 -t1 kp
do
_KEY=$_KEY$kp
... (0 Replies)
Hi ,
i have a scenario where...i have to put a check where if script is executing more than 15mins i have to kill that script and n retry again 2nd time.
i this case i can use background process to do it but i feel trap will be the efficent way to do so...
but i dont know much about it... (1 Reply)
I have a strange problem.
I have the following in a cron to find files older than a day.
find /dir1/dir2/ ! -name . -prune -name "s*.txt" -type f -mtime +1 -exec echo {} \; | wc -w
It was working fine for the last few days now it suddenly stopped working. I can clearly see files in the... (5 Replies)
Hi,
I am writing a C++ application; in which at one point I fork() a new process, which executes a shell script (via execv() call).
Now the shell script can take a while to finish (tarring, burning a cd, etc.) and I would like to update the parent application about the progress (while the script... (3 Replies)
Discussion started by: mirni
3 Replies
LEARN ABOUT OSF1
fsx
fsx(8) System Manager's Manual fsx(8)NAME
fsx - file system exerciser
SYNOPSIS
/usr/field/fsx [-h] [-ofile] [-tn] [-fpath] [-pm]
OPTIONS
The fsx options are: Prints the help messages for the fsx command. Saves the output diagnostics in file. Run time in minutes (n). The
default is to run until the process receives a Ctrl/C or a kill -15 pid command. Number (m) of fsx processes to spawn. The maximum is 250;
the default is 20. Path name of directory on file system you wish to test. For example, /mnt or /usr. The default is /usr/field.
DESCRIPTION
The fsx exerciser spawns the background process fsxr, and these two processes exercise a file system by creating, opening, writing, open-
ing, reading, validating, closing, and unlinking a test file. These test files are created in the /usr/field directory (the default)
unless the -fpath option is used.
You can spawn up to 250 (default is 20) fsx processes (fsxr1, fsxr2, ... fsxrn where n is the number of processes spawned). The exerciser
will run until a Ctrl/C or kill -15 pid command is sent to the process.
A logfile for you to examine and then remove is created in the current working directory. If there are errors in the logfile, make sure you
check the syslog file where the driver and kernel error messages are saved.
RESTRICTIONS
If you must run a system exerciser over an NFS link or on a diskless system, there are some restrictions. For exercisers such as fsx(8),
which must write into a file system, the target file system must be writable by root. Also, the directory in which any of the exercisers
are executed must be writable by root because temporary files are written into the current directory. These latter restrictions are some-
times difficult to overcome because often NFS file systems are mounted in a way that prevents root from writing into them. Some of the
restrictions may be overcome by copying fsx and fsxr to another directory and then executing it. Avoid using the fsx exerciser over an NFS
or diskless file system.
Each time you run fsx, it creates a log file. The exerciser allows you to accumulate up to 9 log files. If you run fsx to create a tenth
log file, it exits and displays the following error messages:
fsx: Remove old log files fsx: Can not start report generator, test aborted
When this situation occurs, remove at least one log file and run fsx again.
EXAMPLES
The following example runs 10 fsx processes on /mnt until the process receives a Ctrl/C or kill -15 pid command: % /usr/field/fsx -p10
-f/mnt The following example runs 20 fsx processes on /usr/field for 120 minutes in the background: % /usr/field/fsx -t120 &
SEE ALSO
Commands: cmx(8), diskx(8), memx(8), shmx(8), tapex(8)fsx(8)