command runs, no output


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting command runs, no output
# 1  
Old 05-07-2008
command runs, no output

I have a script that searches for specific information from log files.

#!/bin/sh
sed -n '/*C/,/END/p' /sn/log/OMlog* > crit.out
sed -n '/REPT INITIALIZATION/,/err:/p' /sn/log/OMlog* > switchcc.out
./start.awk /sn/log/OMlog* > ARs.out
./end.awk /sn/log/OMlog* > ARe.out
cat crit.out switchcc.out ARs.out ARe.out > Audit.out


ideally, it will create the files "crit.out" and "switchcc.out" with no entries in them and it does.
problem is that there is no indication in "Audit.out" that "crit.out" and "switchcc.out" were run without errors.
ideally, I would like something like "crit.out ran successfully" and a time stamp

any ideas would be appreciated,
Al
# 2  
Old 05-07-2008
i rewrote the script adding a line and now it works the way I want it to:


#!/bin/sh
sed -n '/*C/,/END/p' /sn/log/OMlog* > crit.out
sed -n '/REPT INITIALIZATION/,/err:/p' /sn/log/OMlog* > switchcc.out
./start.awk /sn/log/OMlog* > ARs.out
./end.awk /sn/log/OMlog* > ARe.out
ls -l | awk '$5 < 1 {print $9," last successful "$6, $7," "$8" file size = 0"}'
> zero.out
cat zero.out crit.out switchcc.out ARs.out ARe.out > health.report.txt
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Where can I find the program that runs the -wc command?

Hey guys, I was wondering. When I enter a command in the terminal -wcl for a word count, where is that program located in the kernel? (7 Replies)
Discussion started by: Circuits
7 Replies

2. Shell Programming and Scripting

awk runs and produces output but with error

When I run the awk below, I get an error message awk -v OFS='\t' '$(NF-1)=="Benign" || ($(NF-2) OFS $(NF-1))=="Likely Benign" {$(NF)=$(NF-2) OFS $(NF-1)} {print $0 }' input awk: cmd. line:1: (FILENAME=VUS FNR=8) fatal: attempt to access field -1 input Chr Start End Ref ... (6 Replies)
Discussion started by: cmccabe
6 Replies

3. Shell Programming and Scripting

awk runs but output is empty

The awk below runs, however the output file is 0 bytes. It is basically matching input files that are 21 - 259 records to a file of 11,137,660 records. Basically, what it does is use the input files of which there are 4 to search and match in a large 11,000,000 record file and output the... (4 Replies)
Discussion started by: cmccabe
4 Replies

4. Shell Programming and Scripting

Script which telnets to a device, runs commands and prints output to a file

I am connecting to a device using telnet, I want my script to perform certain commands : ie- show device , show inventory..etc and write the output it sees from the terminal to a file. this is what I have got : #!/usr/bin/expect -- set running 1 spawn telnet <ip address> expect ... (1 Reply)
Discussion started by: samantha123
1 Replies

5. Shell Programming and Scripting

Script runs but does not execute rm -rf command

Hi! First off I'm no bin/bash script writer! :( I can make heads and tales of it from the php experience I have and that's all. Now I managed to piece this script together to go look at directory and remove files that are +60 days. It's finding the files but its not removing them. I... (11 Replies)
Discussion started by: MrBiggz
11 Replies

6. Shell Programming and Scripting

How to return a message after command runs?

I have a script like this: echo "enter filername in lowercase" read -e filername exec 2>&1 echo "type the start date in format MM/DD/YYYY" read -e startdate exec 2>&1 echo "enter the end date in format MM/DD/YYYY" ... (2 Replies)
Discussion started by: newbie2010
2 Replies

7. Shell Programming and Scripting

awk command in script gives error while same awk command at prompt runs fine: Why?

Hello all, Here is what my bash script does: sums number columns, saves the tot in new column, outputs if tot >= threshold val: > cat getnon0file.sh #!/bin/bash this="getnon0file.sh" USAGE=$this" InFile="xyz.38" Min="0.05" # awk '{sum=0; for(n=2; n<=NF; n++){sum+=$n};... (4 Replies)
Discussion started by: catalys
4 Replies

8. Shell Programming and Scripting

How long screen command runs?

Does screen command run forever? Suppose I have following command inserted at my putty shell followed by screen # screen # export JAVA_HOME=/usr/java/jdk1.6.0_21 # export ANT_HOME=/usr/ant # export PATH=$PATH:$JAVA_HOME/bin:$ANT_HOME/bin # export... (0 Replies)
Discussion started by: ninadgac
0 Replies

9. Shell Programming and Scripting

Script Runs fine but not giving any output

Hi, My script is running with no erros but not giving any output can anyonehelp. #!/bin/ksh . /home/application/bin/application.env OUTFILE=Result.txt PROD_PASSWORD=`${GET_PWD} -f ${PWD_FILE_PATH} -s ${PROD_SERVER} -u ${PROD_USER}` echo "1)To get the book last loaded details " read... (7 Replies)
Discussion started by: jagadish_gaddam
7 Replies
Login or Register to Ask a Question