Hi,
I need to delete all the lines which does not contain the "error" word in a file.
so, in vi, I would use
:v/error/d and then save the file.
How can I achieve this in command line?
Thanks in advance
User Profile
Collapse
-
How to add vi command in shell script
-
how to define float number in shell script
#! /bin/bash
x=5.2
if [ $x -gt 7.5 ]
then
mail -s "$x is greater than 25" email@address
fi
when i run this code i am getting error intger expression required.
plz tell me how to define this x ?? -
I have run the following command and I am getting the correct output means getting an mail on my email-id with subject “hi”
mailx -s hi abc.xyz@companm .com
--------------------------------------------------------------------------------------------------------
If I want to use the same command in shellscript its not generating the mail
Ex:-
... -
how to mail from unix shell script?
Hi,
#! /bin/bash
x=50
if [ $x -gt 25 ]
then
mail -s "$x is greater than 25" email@address
fi
i have run this command on unix shell script...
their is no error but i am not getting the mail
can anybody tell me what may be the reason?? -
Can u give me a simple example.
Actully i am new to Auto Email, so want to know each step in detailLeave a comment:
-
How to do auto alert email?
Hi!
I need to check everyday log file if anything “error” message on it? If answer yes I like to receive auto email. Please let me know how to write shell script for this auto alert email.plz help me as early as possible.
Thanks and regards
Priyanka -
How to delete the lines from text file?
Hi
i am having an text file
test1.txt contains the following data:
Code:Abcd 2222 ERROR:duplicate ERROR:Getinstrument ERROR:duplicate www xxx
if i use the command :v/ERROR/d
then output :
Code:ERROR:duplicate ERROR:Getinstrument ERROR:duplicate
Last edited by miller; Apr 13 '11, 06:05 PM. -
Reasom for Memory Leakage?
In Perl
i have run the following command
$cpu=`ps -o pcpu -C sbd-java --no-heading`;
i am getting the output
CPU=2.5 or CPU=81.3 sometimes CPU=0
I want to know why their is so much differnce in %CPU ?
may be their is an problm of memory leakage or anything else.Can anyone tell me , what may be the reason?
Thanks,
Priyanka -
How to store output into variable in perl
Hi,
Output of "ps -o etime,time,pcpu ,pmem,fname -C sbd-java"
command is -
Elapsed Time %cpu %MEM COMMAND
02:14:03 00:03:28 2.5 6.3 sbd-java
In shell script-(when i run below code)
X=`ps -o etime,time,pcpu ,pmem,fname -C sbd-java --no-heading|awk '{print $3 }'`;
echo $X
output-2.5
i want use same application in perl script....
No activity results to display
Show More
Leave a comment: