Changing a shell template variable


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Changing a shell template variable
# 1  
Old 05-22-2011
Changing a shell template variable

I'm trying to use a custom command in the configServer loadalert.txt file. the problem is that any command that I place inside the square brackets is simply not working.

PHP Code:
This is a multi-part message in MIME format.
--------------[
boundary]
Content-Typetext/plain;
Content-Transfer-Encoding7bit

Time
:                    [time]
1 Min Load Avg:          [loadavg1]
5 Min Load Avg:          [loadavg5]
15 Min Load Avg:         [loadavg15]
Running/Total Processes: [totprocs]

--------------[
boundary]
Content-Typetext/plain;
Content-Transfer-Encoding7bit
Content
-Dispositionattachment;
 
filename="ps.txt"

Output from ps:
[
top ---n 1]

--------------[
boundary]
Content-Typetext/plain;
Content-Transfer-Encoding7bit
Content
-Dispositionattachment;
 
filename="vmstat.txt" 
Any ideas how I can display the 'top -b -c -n 1' command inside the loadalert file to work?
# 2  
Old 05-22-2011
Post #1 appears to be a partial mail file from a SMTP mail program. Whilst it is not impossible to edit such a file and insert reports ready for a mail program such as "sendmail", there has to be an easier method e.g. "mailx").
I'm assuming that the commands are intended to be run on the local system with the results reported by email.
If this is actually an attempt to find out how to execute commands on a remote system by means of a rogue email message then you will not find the solution here.

Last edited by methyl; 05-22-2011 at 10:55 PM..
# 3  
Old 05-23-2011
This is not a rogue email...Im using Configserver software and I need to edit the commands because the default template only shows list of current processes..I need to list them in sorted order of CPU consumption.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Changing Path Variable

Blank Blank Blank (11 Replies)
Discussion started by: pvibien
11 Replies

2. UNIX for Dummies Questions & Answers

Getting input and changing variable?

Hi I am new to scripting and have a function in my .sh script file that outputs a html radio button form weather_forecast_config() { echo "" echo "<html><head><title>Welcome</title></head>" echo "<body>" echo "<h2>Weather Forecast - Change City</h2>" echo "<form name="input"... (5 Replies)
Discussion started by: scriptnewbie
5 Replies

3. Shell Programming and Scripting

Changing the variable using awk?

Dear all, I have kind of used both the awk/sed command and found them really useful. But at the necessity I am having right now, I need help. Actually, I would like to do the following in file script.sh PATH535="/eos/uscms/store/user/pooja04//analysis2012/535/mc/summer12/002/tt/" ... (2 Replies)
Discussion started by: emily
2 Replies

4. Ubuntu

error LD: undefined variable while changing shell from bash to csh

Hi, i am a beginner in ubuntu. my default shell is bash. everytime i try to change the shell with command "csh", i get a message (probably an error message). after i get into c-shell, when i try to execute a c shellscript, then it showed the same message. any idea about what is this about or any... (1 Reply)
Discussion started by: Avinash Nayak
1 Replies

5. Shell Programming and Scripting

Changing variable name in for loop

Hi All please help if possible. I am a Unix novice. I have a similar question to the one posted by yonderboy at about a year ago. However his solution does not work for me. The pseudo code for my problem is as follows: for fund in 1 2 3 4 if (FTP is successfully) then FILE_SENT_fund... (2 Replies)
Discussion started by: Seether
2 Replies

6. Shell Programming and Scripting

Changing a variable Question

I have a variable: $FILENAME = /XXXX/XXXX/XXXX/file.dat I want to set another variable that will give me this: $FILENAME2=filea.dat So basically i'm chopping up variable $FILENAME. Not sure cut will do this as i'm looking at different directories so the characther length may be... (2 Replies)
Discussion started by: Pablo_beezo
2 Replies

7. Shell Programming and Scripting

Changing value of a variable inside a shell script

I have a continous polling happening inside a shell script on AIX. This actually calls a PL/SQL block. Is there a way I can set up a variable or pass an interrupt to end the script gracefully. I cant read from the config once the job starts running. Ideally I should change value of a variable and... (1 Reply)
Discussion started by: kshyju
1 Replies

8. Shell Programming and Scripting

How to run cmds after changing to a new env (shell) in a shell script

Hi, I am using HP-UNIX. I have a requirement as below I have to change env twice like: cadenv <env> cadenv <env> ccm start -d /dbpath ccm tar -xvf *.tar ccm rcv .... mv *.tar BACKUP but after I do the first cadenv <env> , I am unable to execute any of the later commands . ... (6 Replies)
Discussion started by: charlei
6 Replies

9. Shell Programming and Scripting

IFS changing the variable value

Hi, I have a while read loop that reads files in a directory and process. The files have spaces in between, so I have the IFS=\n to to read the whole line as one file name. The read works fine but I have a problem with another variable that I set in the beginning of the script. The variable... (1 Reply)
Discussion started by: pvar
1 Replies

10. Shell Programming and Scripting

substitution of variable in template

I am a beginner programmer. I have a file that I am able to read through and place the data into variables using the read command. The data is then set to another variable and all the data in that variable resembles the file that I was able to read through, however when I use the sed -e... (1 Reply)
Discussion started by: supercbw
1 Replies
Login or Register to Ask a Question