Error in script to automate the daily monitoring process of UNIX server and it's proc


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Error in script to automate the daily monitoring process of UNIX server and it's proc
# 8  
Old 04-20-2009
Tools poor etiquettes

All I have to say here is that this is the result of a bad coding practice. Indentation helps.

Moreover, experts have repeatedly requested the use of [code] tag.

Code:
if [ I write code like this ];then
    Ppl can help me better
else
    I'll waste a lot of effort and time
fi

# 9  
Old 04-21-2009
The error message means that you have an uneven number of one type of quotes. These could be single quotes, double quotes, or back ticks.

This line for example is suspect. Though the backticks are matched, there are 5 double quote characters. The double quote at the end of the line will cause a syntax error. On re-reading cfajohnson's post I see that he spotted this too and queried the logic!

Code:
61 temp=`ls -lt /root/COMM/LOGS/eds/20081215 | tr -s " " | cut -f6,7,8,9 -d " " `"

This line does not have a syntax problem as such, but does have too many double quotes to be easy to read by eye.

Code:
28 echo "From: "Gnanaprakasam" <gnanaprakasam@yahoo.com>" > $MFILE

28 echo "From: Gnanaprakasam <gnanaprakasam@yahoo.com>" > $MFILE


cfajohnson makes a very good point about using one redirection to $MFILE. It would make the script so much easier to follow. Similarly testing a buggy script as root is not advisible.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Open Source

Help with writing Shell Script to automate process using multiple commands

Hello! Need help to write a Linux script that can be run from windows using command/Cygwin/any other way. I am new to scripting, actually i am trying to automate server health check like free disk space, memory along with few services status, if any services is not running then start services ,... (7 Replies)
Discussion started by: Sayed Ibrahim
7 Replies

2. Shell Programming and Scripting

Script to automate recovery process

Hello All! First post... I am working on a script that is used to recover a crashed drive from an rsync backup. I'm down to the place where I need to create all of the directories in /mnt where I will then mount each of the volumes and begin the restore process to each volume... I have... (3 Replies)
Discussion started by: RogerBaran
3 Replies

3. Emergency UNIX and Linux Support

Monitoring progress of a process in Linux server

Hi friends, I am quite used to using glance in HPUX servers for analysis performance issues with a particular process as requested by app. folks. The options which are very helpful to me are the "F" , "W" , "L" stats. How can i get the similar details on Linux servers without using glance?... (2 Replies)
Discussion started by: kunwar
2 Replies

4. Shell Programming and Scripting

Help me with daily monitoring script

find /usr/IBM/FileNet/BulkUploaderScript/$i/Log/SuccessLog \( -newer range_start -a \! -newer range_end \) -exec wc -l {} \; |awk '{total+=$1-1} END {print total}' >>$LOGFILE I need to print time stamp of the files int the paticular period .Please modify the above script so that i get... (34 Replies)
Discussion started by: RaghavendraT
34 Replies

5. UNIX for Dummies Questions & Answers

Automate sftp process using script

Hi, guys, I am trying to automate a sftp process using "expect" method (since the key authentication method is disabled in my company network, there is no helping it). In order to try, I type in the command manually: sftp @ > << EOF >cd >ls -l >EOF >Connecting to @servername password: ... (3 Replies)
Discussion started by: warmboy610
3 Replies

6. Shell Programming and Scripting

Need help in creating a shell script to automate svnstats process

Hi, I am trying to create a shell script to automate the following process of getting svn stats:- Step1:- cd to checkout location. Note that the checked code have multiple modules in respective folders Step2:- Execute this command inside each module:- svn log -v --xml >... (0 Replies)
Discussion started by: d8011
0 Replies

7. Shell Programming and Scripting

Bash script to Automate the Virtual Host creation process!!

Hi all, This is my sample code in /etc/httpd/conf.d/applications.conf file currently we are creating subdomain mannually for every new subdomain. I want to automate this process througs bash script , how its possible. <VirtualHost *:80> ServerName google.com ServerAlias google.com... (5 Replies)
Discussion started by: anishkumarv
5 Replies

8. Shell Programming and Scripting

automating daily monitoring process

Hi there, I have to automate daily monitoring process and then the result of these process should be sent to a log file, then this log file should be mailed . ps -ef | grep aa In this atleast one process should run. If the process is running it should mention Success in the log file... (3 Replies)
Discussion started by: NehaKrish
3 Replies

9. Shell Programming and Scripting

Automate Log Monitoring Process

I am a new member of this forum and am also new to unix shell scripting. I joined the forum to seek for help to achieve my task as this forum helps people. here's what i do manually on daily basis 1)Loginto different unix box 2)Ftp the log files (morethan 50 each dir) to windows 3)use text pad... (3 Replies)
Discussion started by: sharugan
3 Replies

10. Shell Programming and Scripting

Automate daily FTP files

How to automate FTP files daily with the following constraints 1) Try (every 15 mins or 30 mins) FTP till it reconnects 2) Files that arrive in between 5:30 pm and 2:00 am 3) The sat and sun, mon files are to be FTP on monday. 4) Only the txt files are to be FTP'ed. The following are the... (2 Replies)
Discussion started by: bobbygsk
2 Replies
Login or Register to Ask a Question