Search Results

Search: Posts Made By: manikantants
2,205
Posted By manikantants
Thanks for the correction
Thanks for the correction
13,615
Posted By manikantants
How did you execute your script?
How did you execute your script?
2,205
Posted By manikantants
Assuming your 3rd column is in MB. awk '{ if...
Assuming your 3rd column is in MB.

awk '{ if (FNR==NR) { a[$2]+=$3; next } if (a[$1] < 6000) { print $1 } }' freedata_test.log datafile_test.log
5,181
Posted By manikantants
ls -1t | grep ^- | head | xargs mv <directory> ...
ls -1t | grep ^- | head | xargs mv <directory>

worth trying above line
17,441
Posted By manikantants
There shouldn't be any issue on using '&' Could...
There shouldn't be any issue on using '&'
Could you tell us what Child1.sh Child2.sh does?
3,247
Posted By manikantants
Not very clear. Could you paste a sample input...
Not very clear.
Could you paste a sample input record and expected output record for the same.
2,878
Posted By manikantants
You may try following method. Schedule a...
You may try following method.

Schedule a cron job in your local machine which will check whether file is copied already for the day. If not, it has to connect to the remote machine and try to copy...
4,033
Posted By manikantants
#!/bin/sh date_var=`grep 'Event Time' a.txt...
#!/bin/sh

date_var=`grep 'Event Time' a.txt | head -1 | cut -d= -f2`
date -d $date_var '+%d-%m-%Y-%H-%M'
5,860
Posted By manikantants
read iCOUNT < tmp_file.log ---> Reads content of...
read iCOUNT < tmp_file.log ---> Reads content of tmp_file.log to iCOUNT variable
echo $fCOUNT > tmp_file.log --> Writing fCOUNT to tmp_file.log
iCOUNT=$fCOUNT --> Assigning / Copying value at...
5,860
Posted By manikantants
Say your filename is a.log For the first run,...
Say your filename is a.log
For the first run, iCOUNT and fCOUNT will be same. Hence o/p will be 0.
Script will store the fCOUNT to tmp_file.log and in next run, it will pick iCOUNT from this file....
9,065
Posted By manikantants
am using GNU version of tar and above command is...
am using GNU version of tar and above command is working fine for me.
I am not sure if your version expect myfile.tar since r is present in the tar option. Please try following line (Changed r to c)...
5,860
Posted By manikantants
need to confirm few things. For the first time:...
need to confirm few things.
For the first time:

(1) from which file fcount should be picked up?
(2) from which file icount should be picked up?

For sub sequent run:

(1) from which file...
9,065
Posted By manikantants
I don't see anything wrong with this command. ...
I don't see anything wrong with this command.
Are you getting any error?
Rather did you check myfile.tar, with tvf option?
6,902
Posted By manikantants
echo 20 | awk '{ ndx="1,1"; a[ndx]=$1; } END {...
echo 20 | awk '{ ndx="1,1"; a[ndx]=$1; } END { for (ndx in a) { printf("%s-->%s\n",ndx,a[ndx]); } }'


may be something like this
6,073
Posted By manikantants
you can execute a command in remote host using...
you can execute a command in remote host using ssh.
You can keep your script in local machine and collect IP, hostname from remote machine using ssh.

Start reading ssh man pages.
5,860
Posted By manikantants
am still not clear with the requirment. ...
am still not clear with the requirment.


#!/bin/sh
if [ ! -f a.log ]; then
touch a.log
fi
iCOUNT=`grep -c ERROR a.log`

fCOUNT=`grep -c ERROR b.log`

if [ ${fCOUNT} -gt ${iCOUNT} ];...
6,902
Posted By manikantants
I am not sure if multi dimensioning is supported...
I am not sure if multi dimensioning is supported in awk.
Anyhow we can achieve same result by combining (may be with a delimit) multiple fields.
5,860
Posted By manikantants
It is an infinite loop. There is no break in that...
It is an infinite loop. There is no break in that loop.
You may break the loop by checking some condition.

And I don't understand why a loop is required there.
Pls let us know what is the...
3,051
Posted By manikantants
sett1: ./cwhelper/tcwhelper.cpp@@/main/62 ...
sett1:

./cwhelper/tcwhelper.cpp@@/main/62

sett2:

./cwhelper/tcwauthlatesettreqcreen.hpp@@/main/1
./cwhelper/tcwhelper.cpp@@/main/64

cmp.awk:

first_file=$1
second_file=$2

awk -F@...
3,051
Posted By manikantants
first line is not required. Don't have any...
first line is not required.

Don't have any clue. Someone else has to bump.
3,051
Posted By manikantants
am also using bash and it is working fine for me....
am also using bash and it is working fine for me.

pls check whether awk line is broken
3,051
Posted By manikantants
what i pasted was a oneliner. If you need this...
what i pasted was a oneliner.
If you need this to keep in a file, do it as follows.

first_file=$1
second_file=$2

awk -F@ '{ if (FNR==NR) { a[$1]=0; next } if ($1 in a) { a[$1]=1 } } END { for...
2,436
Posted By manikantants
(1) script will be executed in a new shell (2)...
(1) script will be executed in a new shell
(2) will be executed in the current shell
(3) will be executed in new shell, but script need not to have execute permission
3,051
Posted By manikantants
awk -F@ '{ if (FNR==NR) { a[$1]=0; next } if ($1...
awk -F@ '{ if (FNR==NR) { a[$1]=0; next } if ($1 in a) { a[$1]=1 } } END { for ( i in a ) { if (a[i]==0) { print i } } }' first_file second_file
1,728
Posted By manikantants
-F: --> This declares ":" as the field separator...
-F: --> This declares ":" as the field separator
MSI comes in the 4th word.
If first 3 char of 4th word is "MSI"
print 5th char onwards of 4th word
else
If first word is "Resp" and...
Showing results 1 to 25 of 130

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