Search Results

Search: Posts Made By: kiran1112
826
Posted By kiran1112
Help with consolidating mails sent by executing script
I have a script which checks for swap usage of the unix server.
A cron job has been created to execute this script every hour and send the output via mail.

This output is only required for a...
6,119
Posted By kiran1112
I have'nt figured out that the problm was with...
I have'nt figured out that the problm was with the awk statement initially and did not want to post lengthy code hence posted the other part which was giving error:o
However point noted and will...
6,119
Posted By kiran1112
well I was testing using different scripts and...
well I was testing using different scripts and hence the difference in line numbers..sorry for that.
However I think I found what the problem is..
It has to do with the adding of numbers in a...
6,119
Posted By kiran1112
Ok, thanks for the inputs..I have tried to...
Ok, thanks for the inputs..I have tried to declare them as integers and run the script but still getting the error '1.5321e+08: 0403-057 Syntax error'

typeset -i var1=$V2
typeset -i var2=$TODAY
6,119
Posted By kiran1112
What I meant was comparing two numbers: ie.,...
What I meant was comparing two numbers:

ie., 130830 != 130830

This does not seem to work and so does using '-ne'
any idea why :confused:
6,119
Posted By kiran1112
[Solved] 0403-057 Syntax error for if statement
I am getting the following error when I am running a script in ksh when trying to execute an if statement comparing two numerical values

tstmb.sh[26]: 1.5321e+08: 0403-057 Syntax error

Below is...
13,679
Posted By kiran1112
Thanks for the reply, but I need to check if the...
Thanks for the reply, but I need to check if the 'YYYYMMDD' field in the filename equals to todays date.
I can take today's date into a variable and do a comparison, but how to compare it to only a...
13,679
Posted By kiran1112
Help in script to check file name with todays date
I am trying to include a snippet in my script to check if the file created is having today's date.

eg: File name is : ABC.YYYYMMDD-nnn.log

The script should check if 'YYYYMMDD' in the above...
2,399
Posted By kiran1112
Help in finding & comparing avg file size
I have some files in a directory with two different extensions which get created everyday. Can you please help me out in getting the average file size for both these extensions and checking it with...
1,933
Posted By kiran1112
I am trying to modify the script to include...
I am trying to modify the script to include checking for the filesize and report if it is less than average of the files present in the directory.
I can find average file size using the below...
1,933
Posted By kiran1112
Thanks to you all..used nested for loops and it...
Thanks to you all..used nested for loops and it is working now. :b:
Will test it and comeback if any further modifications are required :)
1,933
Posted By kiran1112
Thankyou for the responses..I have used the...
Thankyou for the responses..I have used the following and it is working now.
However, is there a way to include checking the same criteria in a different directory as well ?

present code:...
1,933
Posted By kiran1112
Help in Shell script to report size of files=0
Hello, I am trying to write a shell script in unix which looks for the last two files in a folder, checks their size and reports(via mail) if either of their file size is =0.

cd /tmp
list last...
1,467
Posted By kiran1112
redirecting output retaining the input
Hi Guys,

I am trying to redirect output from a file to another file while retaining the contents of the input file.
For ex:
cat /tmp/Out1.cfg > test.txt
Now, test.txt would contain the value of...
11,860
Posted By kiran1112
many thanks to everyone :) now i m able to get...
many thanks to everyone :)
now i m able to get the functionality i wanted :)

Thanks a ton!!!

regards
Kiran
11,860
Posted By kiran1112
Yes there is a blank line at the starting of the...
Yes there is a blank line at the starting of the test.log file

but i m writing the script which it clears the existing contents in the test.log file by using the command
echo > test.log
by...
11,860
Posted By kiran1112
ya i tried that too ...but awk 'NR==1 {print...
ya i tried that too ...but

awk 'NR==1 {print $1;exit}' test.log
is printing a blank line and
awk 'NR=1{print $1}' test.log
is printing size of all files ie.,
0
34
12
0
.
.
.


Thnx...
11,860
Posted By kiran1112
Hi Matrix thx for ur reply i m sry...i think...
Hi Matrix thx for ur reply
i m sry...i think you misunderstood me
let me be clear
my test.log contains

0 190_GSTV_HUX_003QISCGSK026_errorXXXXXXXXXXXXX.log
34...
11,860
Posted By kiran1112
Hi all many thanks for all your suggestions ...
Hi all
many thanks for all your suggestions
but none of the commands is able to give the size of only the first line.
the following cmds
awk -F" " 'NR=1{print $1}' test.log
and
sed -n -e...
11,860
Posted By kiran1112
checking size of the first line ina file
Hi My test.log file looks like this:

0 190_GSTV_HUX_003QISCGSK026_error070322_115331917.log
34 190_GSTV_HUX_003QISCGSK026_error070117_151311385.log
12...
9,380
Posted By kiran1112
Thanks vino the cmd which u suggested is...
Thanks vino
the cmd which u suggested is listing all the error files of size 0..
but i want to check for the latest error log file size :(

presently i am able to display only first 3 files in...
9,380
Posted By kiran1112
no Vino no luck with it too... :(
no Vino
no luck with it too...
:(
9,380
Posted By kiran1112
Thanks Jacoden... actually my reqirement is not...
Thanks Jacoden...
actually my reqirement is not just to display those files with zero size but to check if the error log file is of size zero .
pls note that...
9,380
Posted By kiran1112
Hi many thanks for ur quick reply... i am...
Hi
many thanks for ur quick reply...
i am trying to do this:
ls -st 190_GSTV_HUX** >> /home/gaaadmin/GAAAdapter/gskgaa/test.log
cd ..
check=`awk 'NR == 6 {print $1}' test.log`

if [ $check...
9,380
Posted By kiran1112
script to check for a condition inside a file
Hi
I am writing a script file which sends the log files along with their size in a folder named log to a file called temp.log using the following cmd:
ls -st 190_GSTV_HUX_003QISCGSK026** >>...
Showing results 1 to 25 of 25

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