Caveat: Ensure to test this before implementing as I have NOT tested it. Before running the kill command, maybe replace with a echo command just to be on the safer side.
Which "above" are you talking about? More than one script has been posted.
What does "doesn't work" mean exactly? What does happen?
Please post exactly what you tried and exactly what output there was and copy any error messages exactly.
Quote:
Stupid questions:
These questions have nothing to do with HP-UX itself, but with the shell you are using. Make sure that you are using a POSIX shell. That may or may not be /bin/sh.
They are all very basic shell scripting questions, so basic, in fact, that I wonder if they are really what you want to ask.
Quote:
1) How do I assign a value to a variable in hp-unix?
2) How do I concatenate 2 variables in hp-unix?
3) How do I write an "if" statement in hp-unix?
4) How to I extract a piece of a string inside an "if" statement?
Praven,
there is an error message: ps: illegal option -- o usage: ps [-edaflPx] [-u ulist] [-g glist] [-p plist] [-t tlist] [-R prmgroup]
Nicoman,
ps -o does NOT work in HP-UX unless the env variable UNIX95 is set to null or whitespace. That is the reason why the first line of my code was:
Moreover, the script (which initially was erroring out with ps --o is an invalid option) is working fine for me, when I added the export UNIX95=<whitespace> at the beginning of the script.
Anyway, Chris has given u a much simpler option!! As usual, Chris rocks!!
Regards,
Praveen
Last edited by sunpraveen; 03-14-2009 at 05:59 AM..
Hi,
Anyone can help using SED searches a character string for a specified delimiter character, and returns a leading or trailing space/blank.
Text file :
"1"|"ExternalClassDEA519CF5"|"Art1"
"2"|"ExternalClass563EA516C"|"Art3"
"3"|"ExternalClass305ED16B8"|"Art9"
...
...
... (2 Replies)
Hello,
I have a file of strings a below:-
4358RYFHD9845
28/COC/UYF984
9834URD 98HJDU
I need to extract all the first numeric character of every sting as follows:-
4358
28
9834
thanks to suggest ASAP
Regards,
Jasi
Use code tags, thanks. (7 Replies)
Need Assistance in shell programming... I have a huge file which has multiple stations and i wanted to search particular station and extract few lines from it and the rest is not needed
Bold letters are the stations . The whole file has multiple stations .
Below example i wanted to search... (4 Replies)
Suppose there are two files:
A, format is like:
line1 12
line2 33
line3 6
...
B, format is like:
>header
taaccctaaccctaaccctaacccaaccccaccccaaccccaaccccaac
ccaaccctaaccctaaccctaacccaaccctaaccctaaccctaacccaa
ccctcaccctcaccctcaccctcaccctcaccctcaccctcaccctaacc... (1 Reply)
continuing from my previous post, whose link is given below as a reference
https://www.unix.com/shell-programming-scripting/171076-shell-scripting.html#post302573569
consider there is create table commands in a file for eg:
CREATE TABLE `Blahblahblah` (
`id` int(11) NOT NULL... (2 Replies)
If I have a string defined as:
MyString=abcde
echo $MyString
How can I loop through it character by character? I haven't been able to find a way to index the string so that I loop through it.
shew01 (10 Replies)
Hi,
I would like extract from a file a character or pattern after ( n + 1) a specific pattern (n) . ( i supposed with awk)
how could i do ?
Thanks in advance. (1 Reply)