Search Results

Search: Posts Made By: pokerino
1,476
Posted By pokerino
add parameter -i at sed command in sed '...
add parameter -i at sed command in
sed ' /'$previousUID'/ a\'$finel_update' ' passwd.master like sed ' /'$previousUID'/ a\'$finel_update' ' -i passwd.master
1,476
Posted By pokerino
Hi, try with: cat test.txt|sed ' /5005/...
Hi,

try with:

cat test.txt|sed ' /5005/ a\whateveryouwant'
9,483
Posted By pokerino
Hi, try with:
Hi,

try with:
1,065
Posted By pokerino
Hi, another way: VAR=$(find ${dir}...
Hi,

another way:

VAR=$(find ${dir} -type f -exec echo \"{}\"\: \; )
2,471
Posted By pokerino
Hi, NEWDIR=RIO_`date +%d-%b-%Y` if [ -d...
Hi,


NEWDIR=RIO_`date +%d-%b-%Y`
if [ -d $NEWDIR ]
then
echo "exist"
else
echo "Not exist"
fi
1,122
Posted By pokerino
Hi, try this: awk -F" " '/(916)/ {print...
Hi,

try this:

awk -F" " '/(916)/ {print "\t\t\t\t"$0} !/(916)/ {print $0}' filename
1,625
Posted By pokerino
change ; with \n and use echo -e
change ; with \n and use echo -e
1,625
Posted By pokerino
use only bc without -l
use only bc without -l
1,625
Posted By pokerino
Hi, try: echo "($val...
Hi,

try:

echo "($val *3*16384)/(1073741824)"|bc -l
1,268
Posted By pokerino
Hi, you can try also with:echo $*
Hi,

you can try also with:echo $*
2,063
Posted By pokerino
for listing of all files you nedd to add ls
for listing of all files you nedd to add ls
2,063
Posted By pokerino
Hi, you need to escape a space between...
Hi,

you need to escape a space between _South and *.LOG:

/backup/temp/rajesh/12Apr2012_South\ *.LOG
or wrap the path with double quote
6,946
Posted By pokerino
if you want replace value in the file you need to...
if you want replace value in the file you need to add -i option to sed. For a correct replacement of the keyword $value you need to change the single quote to double quote:
sed...
7,077
Posted By pokerino
Hi, to have a personal function in bash you...
Hi,

to have a personal function in bash you can try this:
write a function in a file, i.e. MYFUNC.txt, and in a shell type . MYFUNCT.txt.
Note a space after the dot.

The kind of file you can...
12,597
Posted By pokerino
Hi, another way; cat YUORFILE.txt | awk...
Hi,

another way;

cat YUORFILE.txt | awk -F" " '{ if ( FNR == 1 ) {a=$0;getline} ; {print a"\t"$0;a=$0} }'
1,859
Posted By pokerino
Hi, another way: cat YOURFILE.log|sort...
Hi,

another way:

cat YOURFILE.log|sort -k1,2r|awk -F" " '{a=$2;getline;print $10" "a}'|sort -k1|uniq -c|awk -F" " '{print "IP="$2" Hits="$1" Pattern="$3}'
6,946
Posted By pokerino
in sed command use a double quote instead a...
in sed command use a double quote instead a single quote.
6,946
Posted By pokerino
You can write the filenames replacing $1 and $2. ...
You can write the filenames replacing $1 and $2.
Or insert a variable like $MYFILE_1 and $MYFILE_2, in replace $1 and $2, and put the value in the head fo your big script file.
6,946
Posted By pokerino
You write the code in a file called...
You write the code in a file called newfile.shMake this file executable with chmod 750 newfile.shrun with ./newfile.sh sec.txt disp.txtthe parameter -lt is "less than" you can also use -gt "greater...
6,946
Posted By pokerino
Hi, try this: #!/bin/bash if [ "$(...
Hi,

try this:

#!/bin/bash

if [ "$( cat $1)" -lt "$( sed -n '4 p' $2)" ]
then
echo "less than"
fi
with parameter sec.txt disp.txt
1,376
Posted By pokerino
opensuse 11.4 on i686, bash 4.1.10 You can use...
opensuse 11.4 on i686, bash 4.1.10
You can use this command in cron.
crontab -eand put a line like 30 23 * * * /root/myscriptDelete.sh for execute the command at 11:30 pm
1,376
Posted By pokerino
Hi, try this: rm -rf /backupdir/"$(date...
Hi,

try this:

rm -rf /backupdir/"$(date -d "-2 day" +"%Y%m%d")"*
2,255
Posted By pokerino
have a space after the word? eventually use sed...
have a space after the word?
eventually use sed 's/ *$//g;s/.* .*/"&"/g'
2,255
Posted By pokerino
Hi, try this: cat YOURFILE.txt| awk -F " "...
Hi,

try this:
cat YOURFILE.txt| awk -F " " '/ / {print "\"" $0 "\""};!/ / {print $0}'
1,136
Posted By pokerino
Hi, try with reset
Hi,

try with reset
Showing results 1 to 25 of 36

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