09-08-2016
Ps command different behaviour
Hi Experts,
ps command behavior in Redhat is such that it outputs all the output(of long lengths). In Unix the ps command output was limited to only 80 chars. In that if you pipe its output to another command hen the 80 chars restriction wouldn't be there. This 80 char limitation will only be there for the screen output.
Is there any property/setup file for ps command on redhat which we may tweak to curtail the output to some specific characters?
There is an option --cols n which can curtail the output to n specific chars. But if we use this and pipe to another command, the another command will only get n chars as input from ps command.
My regards,
Albert
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have got a file BeforeSort.txt having 40 fields seperated by "|"
First field= RecordType (Value will be P or FP)
Second field= CamCode
Third field = UpdatingDate
Fourth field = ProductType
Fifth field = ActionCode (Value may be 01, 02 or 03)
Sixth field = ProductCode
and so on
My... (1 Reply)
Discussion started by: pankajrai
1 Replies
2. UNIX for Advanced & Expert Users
Hi guys,
I have the following example data:
A;00:00:19
B;00:01:02
C;00:00:13
D;00:00:16
E;00:02:27
F;00:00:12
G;00:00:21
H;00:00:19
I;00:00:13
J;00:13:22
I run the following sort against it, yet the output is as follows:
sort -t";" +1 -nr example_data.dat
A;00:00:19 (16 Replies)
Discussion started by: miwinter
16 Replies
3. Shell Programming and Scripting
I have a variable, defndata, which is a number (fetched from a file using awk).
I want that if defndata is not initialized (that is its not found in the file using awk), then to execute a block of statements, otherwise execute another block.
if
then
....
else
...
fi
Now this... (4 Replies)
Discussion started by: indianjassi
4 Replies
4. Shell Programming and Scripting
i 've noticed the following difference between freebsd cp and gnu cp
from the freebsd cp man page:
-R ... If the source_file ends in a /, the contents of the directory are copied rather than
the directory itself. ...
on gnu cp from the man pagewhile on gnu cp manpage:
‘-r'... (2 Replies)
Discussion started by: aegis
2 Replies
5. Shell Programming and Scripting
Hi
I am using "trap" command in my script to prevent the user from running Ctrl-C during the its execution. My script creates number of children processes which in turn create some children processes as well during the execution.
When user / tester tries to run Ctrl-C, the parent process is... (1 Reply)
Discussion started by: aoussenko
1 Replies
6. Shell Programming and Scripting
Hi,
Suppose if I have a file having data like this:
$ cat file.txt
A
B C
D
And, if I do a cut operation like this:
$ cut -d" " -f2 file.txt
The output is
A
C
D
This is the same for even if we try to get the field 3 with -f3 (assume line 2 has 3 fields : C E F).
The above... (1 Reply)
Discussion started by: royalibrahim
1 Replies
7. Programming
fg = foreground bg = background
I have a cobol program that I start with a very simple script.
The script is not at fault as it has not changed and the program worked in fg and bg before.
I have altered the logging in the program and moved my cursor declare to working storage.
The program runs... (6 Replies)
Discussion started by: Bruble
6 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I'm trying to understand why the find command below is not listing a directory which was modified long back from the number of days specified in the mtime part. :confused:
user-aster :/mydir
$ ls -ld 1607570a-4fed44bb-4988
drwxr-xr-x 3 xyz abc 4096 Jun 29 01:02 1607570a-4fed44bb-4988... (4 Replies)
Discussion started by: aster007
4 Replies
9. Shell Programming and Scripting
Hello All,
I came across this line in a shell script that I was looking at yesterday. Couldn't get a clue of what it does. :confused:
....
....
blah blah
....
.....
exec >&- 2>&-
......
blah blah
.....
Can someone explain me this??
Usually I have seen exec commands used to... (3 Replies)
Discussion started by: PikK45
3 Replies
10. Shell Programming and Scripting
I have a script as below.
bash-3.00$ cat test.sh
#!/usr/bin/ksh
path=`pwd`
echo $path
var=$path/temp11
echo $var
If run it is giving output
bash-3.00$ ksh test.sh
//var/tmp/SB2/miscellaneous
//var/tmp/SB2/miscellaneous/temp11 (5 Replies)
Discussion started by: millan
5 Replies
LEARN ABOUT DEBIAN
randtype
randtype(1) General Commands Manual randtype(1)
NAME
randtype - Output characters or lines at random intervals
SYNOPSIS
randtype [ -l ] [ -d ,|.<string> [ -k ] ] [ -t <ms,mult> ] [ -w <string> [ -c ms,mult ] ] [ -r s1,s2[:...] ] [ -n <string> ] [ -q <int> ]
[ -m <int> ] [ file ... ]
DESCRIPTION
randtype reads input from either standard input or from a file and outputs each character or line at random intervals. If multiple files
are specified, each is read in sequence.
OPTIONS
randtype recognizes the following command line options:
-c ms,mult
For optional use with the -w option, this has the same microsecond and multiplier value format as the -t option. The default for
this option is specified at compile time.
-d string
Output everything before (left) or after (right) the specified string immediately. The string must begin with either ',' or '.'
which specifies the direction, left or right, respectively.
-h Print a summary of the command line options and exit.
-k Suppress output of the string specified by the dump string option.
-l Output lines rather than characters. Only the -t and -q options are valid when using this option, all other options are ignored.
-m int Generate random mistakes. The int value is how many times to compare and match the next character and a randomly generated charac-
ter.
-n chars
Output the specified characters immediately with no random waiting.
-r s1,s2[:...]
Replace the string s1 with string s2. You can specify multiple replacements by separating them with a ':'.
-q int Quit the program after this many seconds.
-t ms,mult
This option refines the random delay of output. The value of the argument is separated by a comma with the first argument being a
microsecond and the second being a multiplier of a random number between 0 and the microsecond. A character-per-second effect can,
for example, be made by setting the microsecond to 0 and the multiplier to 1000000. The default for this option is specified at com-
pile time.
-v Display version information and exit.
-w chars
The inverse of the -n option; this option waits on the specified characters. Use the -c option to refine the random delay of output.
EXAMPLE
randtype -t 13,16000 -d ",*MAGIC*" -k -n '0ou' filename
SEE ALSO
random(3), srandom(3), alarm(2), select(2)
AUTHOR
This program was created by bjk <bjk@arbornet.org> and released under the terms of the GNU General Public License version 2 or later.
randtype randtype(1)