Search Results

Search: Posts Made By: Nysif Steve
29,614
Posted By Nysif Steve
Still the same error. Here is a larger portion of...
Still the same error. Here is a larger portion of the code:


((startTime= `perl -e 'print time;'`))
((currentTime= $startTime))
((executeTime= $startTime))
tempTime=`date +%H%M`

...
4,889
Posted By Nysif Steve
The error still reads: ...
The error still reads:


./statreports.sh[27]: if[: not found
./statreports.sh[28]: syntax error at line 29 : `then' unexpected
4,889
Posted By Nysif Steve
Script Error if ... then
I am trying to debug a script. I am getting the error following errors from the code listed below. I am working in Korn shell in a Sun Solaris UNIX environment.

****************
** Error Message...
29,614
Posted By Nysif Steve
The user knows to call the script with either 1...
The user knows to call the script with either 1 or 2 command arguments. Depending on the call I need the script to perform different operations. How exactly would I check if the second command...
29,614
Posted By Nysif Steve
Check for Empty Command Argument
I have a script that when called can have 1 or 2 command arguments. If only 1 command argument is passed into the script how can I check that the second argument is null? I am working in Korn shell...
3,334
Posted By Nysif Steve
Time Calculations & Conversions
I have script that runs based on time variables passed in the command line. The first command argument is a timer, in seconds, of how often to execute a certain loop in the script. The second ...
3,455
Posted By Nysif Steve
The perl -e command is working. Thank you for...
The perl -e command is working. Thank you for your help.
3,455
Posted By Nysif Steve
I ran the man command on the date function. It...
I ran the man command on the date function. It doesn't seem to have an option for epoch time. What you suggested sounds like it'd fit what I am trying to do perfectly. How do I check the version on...
3,455
Posted By Nysif Steve
date +%s prints %s to the screen
date +%s prints %s to the screen
3,455
Posted By Nysif Steve
Time Calculations
I'm trying to have a loop print out statistics every X number of seconds. How can I add a specific number of seconds to a time variable and make a comparison? Thanks ahead of time.

For example:
...
36,499
Posted By Nysif Steve
Try using one of these free text editors. They...
Try using one of these free text editors. They have much more functionality.

Textpad
TextPad - the text editor for Windows (http://www.textpad.com)

Programmers File Editor (PFE)
Programmer's...
Forum: What is on Your Mind? 09-04-2007
32
12,484
Posted By Nysif Steve
I think the question should be fine tuned to:...
I think the question should be fine tuned to: What came first the Chicken or the Chicken Egg.
20,199
Posted By Nysif Steve
I ended up using the code: cat logfile |...
I ended up using the code:


cat logfile | sort | uniq -c -n6 >> logreport


For the uniq command the -c flag will print the number of occurences before each line while the -n6 flag will ignore...
Forum: Infrastructure Monitoring 09-04-2007
4,238
Posted By Nysif Steve
I ended up using the code: cat logfile |...
I ended up using the code:

cat logfile | sort | uniq -c -n6 >> logreport


For the uniq command the -c flag will print the number of occurences before each line while the -n6 flag will ignore...
20,199
Posted By Nysif Steve
For reference I am using the ksh shell. I was...
For reference I am using the ksh shell. I was able to get the code to run however, some errors came back more then once.

For example:

15:35:58 sendmail[23246]: [ID 702911 mail.alert] unable to...
20,199
Posted By Nysif Steve
What exactly is the output from this? I can't get...
What exactly is the output from this? I can't get it to run correctly.


awk '{x[substr($0,9)]++;y[substr($0,9)]=$1}END{
for(i in x)
printf "%s\nThis Error was reproduced %d times\n",y[i]i,x[i]...
3,613
Posted By Nysif Steve
Try: Echo "computerhope.com IP address is...
Try:

Echo "computerhope.com IP address is `nslookup www.computerhope.com | grep "Address" | nawk '{printf $2}'`"


P.S. The Red marks are not single quotes, they are on the same key as [~] .
Forum: Infrastructure Monitoring 08-31-2007
4,238
Posted By Nysif Steve
Remove Similar Lines from a File
I have a log file "logreport" that contains several lines as seen below:


04:20:00 /usr/lib/snmp/snmpdx: [ID 702911 daemon.error] Agent snmpd appeared dead but responded to ping
06:38:08...
2,248
Posted By Nysif Steve
Thank you for your help!
Thank you for your help!
Forum: Infrastructure Monitoring 08-30-2007
2,367
Posted By Nysif Steve
Remove Similar entries in a File
--------------------------------------------------------------------------------

I have a log file "logreport" that contains several lines as seen below:


04:20:00 /usr/lib/snmp/snmpdx: [ID...
20,199
Posted By Nysif Steve
Remove Duplicate lines from File
I have a log file "logreport" that contains several lines as seen below:

04:20:00 /usr/lib/snmp/snmpdx: [ID 702911 daemon.error] Agent snmpd appeared dead but responded to ping
06:38:08...
2,248
Posted By Nysif Steve
It seems to be printing out the right output. Say...
It seems to be printing out the right output. Say I wanted to replace the 30 with a variable $previousday, would this still hold up?
2,199
Posted By Nysif Steve
I haven't tested this yet but, will this work for...
I haven't tested this yet but, will this work for multiple lines in the log file? I would like to implement this so it will go through every line with a date of Aug 30?
2,199
Posted By Nysif Steve
Script lines of a Log Files
I am creating a script that will look through a log file and print the previous days entries. However I do not want the complete line of the entry.

A single line of the log file is as follows:
...
2,248
Posted By Nysif Steve
Printing a Line from a file
I have a log file with several lines as follows:

Aug 30 06:35:08 trnwvltfit1 /usr/lib/snmp/snmpdx: [ID 702911 daemon.error] Agent snmpd appeared dead but responded to ping

I am using the date...
Showing results 1 to 25 of 26

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