10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i have the following code:
APIDS=$(echo $(ps -ef | awk -v gpid="${gpid}" '$2 == gpid || $3 == gpid {print $2,$3}') | sed 's~ ~|~g')
AllProcs=$(ps -ef | awk -v allpids="${APIDS}" '$2 ~ allpids || $3 ~ allpids {print $0}' | sed '/^$/d')
it seems the above... (6 Replies)
Discussion started by: SkySmart
6 Replies
2. UNIX for Beginners Questions & Answers
Hi,
Here is my command
print $2 was meant to select the second column however, it is getting substituted with the second argument that was passed to the script.
Can you please tell me how can I resolve this ? (6 Replies)
Discussion started by: mohtashims
6 Replies
3. Shell Programming and Scripting
mkdir logs
mkdir: Failed to make directory "logs"; File existsTo avoid this error i use the -p argument so it creates a folder only if it is does not exists like you see below.
mkdir -p logs In the similar manner i wish to avoid this error with ln command
ln -s /tmp/myfolder var
ln: cannot... (4 Replies)
Discussion started by: mohtashims
4 Replies
4. Shell Programming and Scripting
Hi,
I am using awk here.
Inside an awk script, I have a variable which contains a very long XML data in string format (500kb).
I want to pass this data (as argument) to curl command using system function.
But getting Too many arguments error due to length of string data(payloadBlock).
I... (4 Replies)
Discussion started by: cool.aquarian
4 Replies
5. Shell Programming and Scripting
Hi I have a script which runs the isql command and takes the output in a xls file.
Is there a way to trim the spaces(leading and trailing) from all the values in the column of the xls sheet? (6 Replies)
Discussion started by: Sharma331
6 Replies
6. Shell Programming and Scripting
Hi,
I am having multiple echo statements to print output
echo "$VAr"
echo "$lenght"
echo "$sum"
I get the output as
12
24
36
I need the output to be 12 24 36.
How do i arrive at this.
Thanks in advance (4 Replies)
Discussion started by: krashraj
4 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I have 2 queries
1 .when I run some unix command, I am getting the output of "time" at std output (screen)
for eg
zegrep <pattern> *.v.gz
I almost found the reason but not sure, if the no of files matching *.v.gz is more then I am getting the time command output at the... (5 Replies)
Discussion started by: selvaka
5 Replies
8. Solaris
Hello,
this is solaris 10 on SF v440,
I know below errors might go away if I put a new PS or put the original one back in socket but is there any other way to stop these errors from appearing in /var/adm/messages ? I do not want to put the failed PS1 in socket neither do we want to spend on... (5 Replies)
Discussion started by: upengan78
5 Replies
9. Shell Programming and Scripting
Hi...
I need a help in using the awk command or any other solution to avoid the usage of loops.
My question is :
I have a input like this :
field1|field2|field3|field4|field5|field6|field7|field8|field9
ex : 4000|testing|scenario|14450|500|320|450|200|100
where the... (2 Replies)
Discussion started by: vijayarajvp
2 Replies
10. Shell Programming and Scripting
I am sending a kill comand to kill a process inside a SH script but I don`t want the user to notice it so I donīt want the message "1222 killed" to appear.
I`ve tried to redirect the standard output to /dev/null 2>&1 and also tried to use "nohup" but none of them was succesfull.
Can anyone... (1 Reply)
Discussion started by: pguinal
1 Replies