Search Results

Search: Posts Made By: reddyrajal
2,267
Posted By reddyrajal
try this grep -i -E '(^handle|memory module...
try this
grep -i -E '(^handle|memory module information)' -A 8
4,028
Posted By reddyrajal
try this if [ $# -eq 1 -a "$ACTION" =...
try this

if [ $# -eq 1 -a "$ACTION" = "PAGE" -o "$ACTION" = "PULSE" ]


u need to give space before and after [
and when you compare numeric values use -eq and for strings use =
1,198
Posted By reddyrajal
try this echo -n "enter date: ";read DATE...
try this

echo -n "enter date: ";read DATE && ll --time-style="+%F %T" | awk 'NR>1{ for(i=6;i<NF;i++){printf "%s ",$i} print $NF }' | grep ^"$DATE"


you need to give date in 2008-12-22
...
4,340
Posted By reddyrajal
try this #!/bin/sh COUNTER=0 echo -n...
try this
#!/bin/sh

COUNTER=0
echo -n "Enter the directory path: ";
read DIRECTORY
echo $DIRECTORY
cd $DIRECTORY

for FILE in `ls | grep -v _tmp$ `
do

echo $COUNTER $FILE

if [ -e...
4,340
Posted By reddyrajal
try this #!/bin/sh COUNTER=0 echo -n...
try this
#!/bin/sh

COUNTER=0
echo -n "Enter the directory path: ";
read DIRECTORY
echo $DIRECTORY
cd $DIRECTORY

for FILE in `ls | grep -v _tmp$ `
do

echo $COUNTER $FILE

if [ -e...
3,132
Posted By reddyrajal
try this cat file 2 a b c 2 g h i 3 l...
try this

cat file
2 a b c
2 g h i
3 l k m
3 o p a
4 r t f

awk '{print $1}' file | sort -u | while read line; do grep ^$line file | tail -1 ; done
2 g h i
3 o p a
4 r t f

this will...
3,238
Posted By reddyrajal
try this echo -ne "$VAR \n"
try this echo -ne "$VAR \n"
4,977
Posted By reddyrajal
start=1; grep -n ^$ file | sed s/:// | while...
start=1;
grep -n ^$ file | sed s/:// | while read lineno
do
end=$lineno;
cat file | sed -n "$start,$end p" | grep -m 1 Enter
cat file | sed -n "$start,$end p" | grep -m 1 "SQL RUN"
cat...
4,977
Posted By reddyrajal
A for after grep -A 3 print three lines
A for after
grep -A 3 print three lines
4,977
Posted By reddyrajal
cat file Enter value for authid: 560000 ...
cat file

Enter value for authid: 560000
SQL RUN TIME--- 22-12-2008 13:57:29
@lienup.sql SELECTED VALUE
Enter value for authid: 560000
SQL RUN TIME--- 22-12-2008 13:57:29
@lienup.sql SELECTED...
4,977
Posted By reddyrajal
cat list DELETE:MD:TM,432350214576013; ...
cat list
DELETE:MD:TM,432350214576013;

RESP:940120105;
DELETE:MD:TM,432350415547447;

RESP:940120105;

SET:NOK:TM,432350110811018:T22,0;

RESP:11000999;
SET:MD:TM,4323500223734641;
...
4,977
Posted By reddyrajal
sorry command is grep -B 1 ^$ file | egrep...
sorry command is

grep -B 1 ^$ file | egrep 'x|Y|Z'

can u post sample data
4,977
Posted By reddyrajal
grep -B 1 ^$ | egrep 'x|Y|Z' file ^$ for...
grep -B 1 ^$ | egrep 'x|Y|Z' file

^$ for blank line and -B 1 prints blank line and before line
3,720
Posted By reddyrajal
try this it may help you egrep -n '\(|x' list |...
try this it may help you egrep -n '\(|x' list | sort -n
5,359
Posted By reddyrajal
even if files are not sorted my method is...
even if files are not sorted my method is efficient u can use this method any no of files
5,359
Posted By reddyrajal
here is my small test time for taking grep method...
here is my small test time for taking grep method and my method
shell>wc -l file*
28684 file1
4993 file2
shell> time grep -f file1 file2 |wc -l
4953

real 5m34.005s
user 5m26.267s...
5,359
Posted By reddyrajal
shell> cat file1 111 222 333 444 ...
shell> cat file1
111
222
333
444
shell> cat file2
222
444
666
888
shell> cat file1 file2 | sort | uniq -d
222
444
shell> cat file1 file2 file2 | sort | uniq -u
111
333
5,359
Posted By reddyrajal
cat file1 file2 | sort | uniq -d cat file1...
cat file1 file2 | sort | uniq -d
cat file1 file2 file2 | sort | uniq -u
115,644
Posted By reddyrajal
return value is stored in $? #!/bin/sh ...
return value is stored in $?
#!/bin/sh

test_return()
{
a=10
return $a
}

test_return
echo $?
1,480
Posted By reddyrajal
awk -F"phonenumber:" '{ for(i=1;i<NF;i++){printf...
awk -F"phonenumber:" '{ for(i=1;i<NF;i++){printf "%s phonenumber: %s\n",$1,$(i+1)} }' test.txt
uid: 1001010790901; phonenumber: 3169432296|abc abc
uid: 1001008050805; phonenumber: ...
1,480
Posted By reddyrajal
awk -F"phonenumber:" '{ for(i=1;i<NF;i++){printf...
awk -F"phonenumber:" '{ for(i=1;i<NF;i++){printf "%s phonenumber: %s\n",$1,$(i+1)} }' test.txt
Showing results 1 to 21 of 21

 
All times are GMT -4. The time now is 04:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy