Search Results

Search: Posts Made By: mahendramahendr
15,564
Posted By mahendramahendr
Anbu23 The above mentioned stuff does the...
Anbu23

The above mentioned stuff does the samething as what you posted... seems like you have searched whole forum and posted the same :)
15,564
Posted By mahendramahendr
Great... I got an enhancement to it printf...
Great... I got an enhancement to it

printf ("FAIL=%d;SUCCESS=%d;TOTAL=%d",totalfailrecs,totalsuccessrecs,totalrecs);


then call the awk script in shell script

str=$(awk -f test.awk...
15,564
Posted By mahendramahendr
I don't think we can retrieve values from awk to...
I don't think we can retrieve values from awk to unix shell... when awk finishes we loose all it values... I can provide you another alternative method instead of creating and parsing it..

a1.awk...
8,229
Posted By mahendramahendr
I have also read somewhere that */4 works in...
I have also read somewhere that */4 works in cron, but in solaris it never worked for me... don't use this method.
110,024
Posted By mahendramahendr
Read more about cpu allocation for process to...
Read more about cpu allocation for process to know... this is how unix/any other operating system works and nothing much we can do
3,108
Posted By mahendramahendr
what is process id ? please post the full ps...
what is process id ? please post the full ps output
6,498
Posted By mahendramahendr
There are many ways in doing it... one is based...
There are many ways in doing it... one is based on the time the file created in the system and the other way is based on date in the file name...

There will be a problem with the first method...
6,819
Posted By mahendramahendr
Even in unix "su - " do not pass env variables to...
Even in unix "su - " do not pass env variables to the new shell... it is just "su"

To become user bin while retaining your previously exported
environment, execute:

example% su...
6,819
Posted By mahendramahendr
check what is the default shell and what is the...
check what is the default shell and what is the profile file loaded... i guess profile and shell settings could be the problem.. they might be different in your unix and linux box
110,024
Posted By mahendramahendr
add echo $n inside the while loop... and see...
add echo $n inside the while loop... and see where it goes into sleep state. I guess it shows as S even if your process is doing something... because I can see that the script is actually...
110,024
Posted By mahendramahendr
fg and bg is not for making the process sleep and...
fg and bg is not for making the process sleep and wake up... it is to make the process to go background and bring the process to back in case if it require any inputs...

if the process is...
1,820
Posted By mahendramahendr
#!/usr/bin/ksh flg=$(tail -1 file | egrep...
#!/usr/bin/ksh

flg=$(tail -1 file | egrep -ch "^RUNNING|^DOWN")

if [ $flg -ne 0 ]
then
echo "Call another command here...!!"
fi
1,828
Posted By mahendramahendr
I don't see any validations above. They are...
I don't see any validations above. They are simply extracting and assigning...
Please explain in details what you want to do.
5,887
Posted By mahendramahendr
oh yaa... it looks good and more readable.. ...
oh yaa... it looks good and more readable..

though I always use tabs in coding, they are not visible in html... thanks again... will use code.
2,729
Posted By mahendramahendr
Just try... the following two commands ls...
Just try... the following two commands

ls -lrt *.CSV
ls -lrt

In the second command you will find additional line something like "total 6"... this is causing the blank line...

if you want...
2,729
Posted By mahendramahendr
ls -lrt | grep -v "^d" | awk '{print $9}' ...
ls -lrt | grep -v "^d" | awk '{print $9}'


remove * from ls command and shift grep one step ahead... because if you put awk first, it takes only the 9 th column ( i.e file name )... then no...
5,887
Posted By mahendramahendr
#!/usr/bin/perl -w $file="test.txt"; ...
#!/usr/bin/perl -w

$file="test.txt";

print "Enter search string : ";
$str=<STDIN>;
chomp $str;

open(FH,$file) || die "Unable to open $file : $!\n";

my $line;
my $strt_str=0;
my...
2,194
Posted By mahendramahendr
Try whether this helps $ egrep "bootpc|ssh"...
Try whether this helps

$ egrep "bootpc|ssh" fname;egrep -v "bootpc|ssh" fname | nawk -F":|-" '{ print $2}'
*:bootpc
*:ssh
42904
47380
2,833
Posted By mahendramahendr
I guess we can have more than 9 params using...
I guess we can have more than 9 params using shift command....

It is long time since I used these I don't remember well.
2,652
Posted By mahendramahendr
Have you maintained your server IP in .rhosts...
Have you maintained your server IP in .rhosts file in home directory of remote computer.

Or you can also maintain it in /etc/hosts.equiv

If you do this, it won't generally ask password. If you...
2,083
Posted By mahendramahendr
ls -rt | grep -v '^archive$' | sed '$d' | xargs...
ls -rt | grep -v '^archive$' | sed '$d' | xargs -I{} mv {} archive/{}.orig


I guess archive is the folder, then just add "/{}.orig" in the end
2,833
Posted By mahendramahendr
#!/usr/bin/ksh fname="$1" fldr="/tmp" ...
#!/usr/bin/ksh

fname="$1"

fldr="/tmp"

if [ -f "$fldr/$fname" ]
then
echo "File exists... congrats !!"
else
echo "File don't exists..!!"
fi
3,458
Posted By mahendramahendr
Just remove "^" from the all the above scripts if...
Just remove "^" from the all the above scripts if you feel that "START" can be anywhere in the line.

Read man awk or some perl documentation.....
3,458
Posted By mahendramahendr
$ more test.pl #!/usr/bin/perl -w ...
$ more test.pl
#!/usr/bin/perl -w

$file="test.txt";

open(FH,$file) || die "Unable to open $file : $!\n";

my $line;
my $strt_str=0;
my @arr=();

while ( $line = <FH> )
{
chomp...
31,831
Posted By mahendramahendr
This topic has been discussed many times, a quick...
This topic has been discussed many times, a quick search through this forum can help you
Showing results 1 to 25 of 219

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