cd destFold # reach to destination folder
ls sh*.* | sed 's/\..*//g' | sort -u | while read line # list files which are in sh*.* format | remove everything after . with sed(i.e. sh123.12 will become sh123) | sort them uniquely | one by one read filenames(i.e. sh123, sh1234, sh12, etc..)
do
cnt=`ls ${line}.* | wc -l` # take count of files in destFold directory
if [ $cnt -ge 15 ] ; then # if count is greater then 15
pid=`echo "$line" | sed -n 's/sh//g'` # extract pid from line by removing sh(i.e. sh123 will be 123, sh1234 will be 1234)
kill -9 $pid # kill that pid as requested
else
echo "" # else do nothing
fi
done
This is only for 1 time. If u want this to be monitored then run while loop again in loop.
Hi,
I have file 1.txt with following entries as shown:
0152364|134444|10.20.30.40|015236433
0233654|122555|10.20.30.50|023365433
**
**
**
In file 2.txt I have the following entries as shown:
0152364|134444|10.20.30.40|015236433
0233654|122555|10.20.30.50|023365433... (4 Replies)
Hi Folks,
I have the following requirement:
I have a file that is containing numerous queries. The tables name mentioned in the queries are in the following format : SchemaName.Tablename. e.g COPDB.TableName.
I need to take out all the COPDB.TableName pattern and write it to a different... (0 Replies)
Hi Folks,
I have the following requirement:
I have a file that is containing numerous queries. The tables name mentioned in the queries are in the following format : SchemaName.Tablename. e.g COPDB.TableName.
I need to take out all the COPDB.TableName pattern and write it to a different... (6 Replies)
Hi all,
I'm looking for some help. I have a file (very long) that is organized like below:
>Cluster 0
0 283nt, >01_FRYJ6ZM12HMXZS... at +/99%
1 279nt, >01_FRYJ6ZM12HN12A... at +/99%
2 281nt, >01_FRYJ6ZM12HM4TS... at +/99%
3 283nt, >01_FRYJ6ZM12HM946... at +/99%
4 279nt,... (4 Replies)
All,
I have the following file:
--------------------------------------
#
# /etc/pam.d/common-password - password-related modules common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of modules that define the services... (2 Replies)
Hi,
I am trying to get a result out of this but fails please help. Have two files /tmp/1 & /tmp/hosts.
/tmp/1
IP=123.456.789.01
WAS_HOSTNAME=abcdefgh.was.tb.dsdc
/tmp/hosts
123.456.789.01
I want this result in /tmp/hosts if hostname is already there dont want duplicate entry.
... (5 Replies)
'Hi
I'm using the following code to extract the lines(and redirect them to a txt file) after the pattern match. But the output is inclusive of the line with pattern match.
Which option is to be used to exclude the line containing the pattern?
sed -n '/Conn.*User/,$p' > consumers.txt (11 Replies)
The sample file:
dept1: user1,user2,user3
dept2: user4,user5,user6
dept3: user7,user8,user9
I want to match by '/^dept2.*/' but don't want to have substring 'dept2:' in output. How to compose such regex? (8 Replies)
Hi all!
Thanks for taking the time to view this!
I want to grep out all lines of a file that starts with pattern 1 but also does not match with the second pattern.
Example:
Drink a soda
Eat a banana
Eat multiple bananas
Drink an apple juice
Eat an apple
Eat multiple apples
I... (8 Replies)
Hi
I need to do a patten match between files .
I am new to shell scripting and have come up with this so far. It take 50 seconds to process files of 2mb size . I need to tune this code as file size will be around 50mb and need to save time.
Main issue is that I need to search the pattern from... (2 Replies)
Discussion started by: nitin_daharwal
2 Replies
LEARN ABOUT ULTRIX
cmx
cmx(8) System Manager's Manual cmx(8)Name
cmx - generic communication exerciser
Syntax
/usr/field/cmx [ -h ] [ -ofile ] [ -tn ] -l line-1 ...
Description
The exerciser will write, read, and validate random data and packet lengths on a given communications line. The line under test must have
a loopback connector attached to the distribution panel or the cable and the line must be disabled in the file and a non-modem line. That
is, the flag must be set to off.
The exerciser runs until or kill -15 pid is sent to the process.
A logfile is made in for you to examine and then remove. If there are errors listed in the logfile, make sure that you check the file,
because that is where the driver and kernel error messages are saved.
You must specify the -l flag followed by the lines to test. The line-n arguments identify the lines to be tested. A maximum of 32 lines
can be tested at any one time. The line-n arguments are specified as names taken from the directory without the letters ``tty''. For
example, if the directory lists tty03, the line argument is 03.
The DEVICES section lists the devices that can be tested.
Restrictions
If there is a need to run a system exerciser over an NFS link or on a diskless system there are some restrictions. For exercisers that
need to write into a file system, such as the target file system must be writable by root. Also the directory, in which any of the exer-
cisers are executed, must be writable by root because temporary files are written into the current directory. These latter restrictions
are sometimes 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 the exerciser to another directory and then executing it.
Options-h Prints help message about this command.
-ofile Save output diagnostics in file.
-tn Run time in minutes (n). The default is to run until a or kill -15 pid is sent to the process.
Restrictions
Pseudo devices (those whose first character after tty is p, q, r, s, t, u) cannot be tested. Neither can lta devices with major #39.
Devices
Use the command on to find out which tty line corresponds to a device line number.
Examples
The following example runs the exerciser for 60 minutes on lines 00, 13, 22, and 32.
% /usr/field/cmx -t60 -l 00 13 22 32
The following example runs the exerciser on lines 11, 42, 45, and 76 in the background until interrupted by a or kill -15 pid.
% /usr/field/cmx -l 11 42 45 76 &
See Also
Guide to System Exercisers
cmx(8)