Sponsored Content
Top Forums Shell Programming and Scripting [Solved] adding email option to KSH Post 302685941 by vpundit on Monday 13th of August 2012 04:37:16 PM
Old 08-13-2012
[Solved] adding email option to KSH

Hi,

I wanted to add a email option to this script. and was wondering if anyone could help me out.


Code:
#!/bin/ksh


echo "Finding hdisk"
<DIR>/find-disk
i=1
b=0
p=0
while [ $i -le 100 ]                                                                                                                                         
do
   o=1
   while [ $b -ge 0 ]
   do
      echo "\b\c"
      (( b -= 1 ))
   done

   while [ $o -le i ]
   do
   echo "=\c"
   (( o += 1 ))
   done
   b=$(( o + 3 ))
   [ p -eq 3 ] && p=0
   [ p -eq 0 ] && CAR='|'
   [ p -eq 1 ] && CAR='/'
   [ p -eq 2 ] && CAR='\'
   (( p += 1 ))

   echo " ${CAR} $i%\c"
   sleep 0
   (( i += 1 ))
done
echo

echo "Processing hdisk total space"
<DIR>/hdisk-2145.ksh
i=1
b=0
p=0
while [ $i -le 100 ]                                                                                                                                         
do
   o=1
   while [ $b -ge 0 ]
   do
      echo "\b\c"
      (( b -= 1 ))
   done

   while [ $o -le i ]
   do
   echo "=\c"
   (( o += 1 ))
   done
   b=$(( o + 3 ))
   [ p -eq 3 ] && p=0
   [ p -eq 0 ] && CAR='|'
   [ p -eq 1 ] && CAR='/'
   [ p -eq 2 ] && CAR='\'
   (( p += 1 ))

   echo " ${CAR} $i%\c"
   sleep 0
   (( i += 1 ))
done
echo
rm -r <DIR>/hdisk
echo "Completed! View Log <DIR>/hdisk-2145"

The output file is the file I would like emailed.

Code:
echo "Completed! View Log <DIR>/hdisk-2145

I want this file to be emailed to me.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

KSH : Disable -x option

I have a KSH script. I want NO-ONE to call it with -x option. example : ksh -x /appl/u001/test_it_out.ksh Is there a way to know, from with in script, that they invoked the script with -x option. So that I can exit when they invoke it with -x option. please help. (2 Replies)
Discussion started by: vangaru
2 Replies

2. Shell Programming and Scripting

Adding an Option

I have a file that takes 2 or 3 arguments... ie: $argv(2), $argv(3) If I had to add another argument, I would be ok, but nooo.. that would be too easy for the new programmer. Before you go there - This is not a school problem, it's a real world problem.. If I wanted to add an option, for... (1 Reply)
Discussion started by: Brusimm
1 Replies

3. Programming

probs adding linker option in g++

Hi all Im trying to compile a C++ program, however Im having issues trying to link a particular library to the compiling and linking statement. Here is what Im doing g++ mips4 -std=c++98 -g disk_reporter.cpp -o disk_reporter If I do this alone, the linker complains that library... (2 Replies)
Discussion started by: JamesGoh
2 Replies

4. Shell Programming and Scripting

KSH script to run other ksh scripts and output it to a file and/or email

Hi I am new to this Scripting process and would like to know How can i write a ksh script that will call other ksh scripts and write the output to a file and/or email. For example ------- Script ABC ------- a.ksh b.ksh c.ksh I need to call all three scripts execute them and... (2 Replies)
Discussion started by: pacifican
2 Replies

5. Shell Programming and Scripting

how do I change the email sender if I donot have the -r option?

Hey, after I check the man page for mail and mailx, I did not find the -r option. But, I have to change the email sender, how can I do it? Send Mode mailx address... Receive Mode mailx -e mailx mailx -f ... (0 Replies)
Discussion started by: freelong
0 Replies

6. Shell Programming and Scripting

Email with cc and bcc option

Hi, I am able to send email from AIX using the following command. cat email.txt | mail -s "Mail Subject" venkat@gmail.com Our requirement is send email with cc and bcc option. We are getting email with from email address as our UNIX server user. We would like to change that, please let us know... (2 Replies)
Discussion started by: vfrg
2 Replies

7. Shell Programming and Scripting

ping script with email option

Hi I have already posted about this issue here and I got reply from some members. Now I need few modifications to be done. Can someone assist ? I need a script to be put in cron and this script should run everyday morning at 06:00 AM. I have a filed named "network_hosts" and the below are... (7 Replies)
Discussion started by: newtoaixos
7 Replies

8. HP-UX

[Solved] Adding a column.

Hi, Please see the output below. CPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND 0 ? 92 root 152 20 144K 128K run 667:31 1.85 1.85 fcachedaemon 22 ? 10957 patrol 154 30 68036K 35704K sleep 571:43 1.53 1.53 PatrolAgent 0... (22 Replies)
Discussion started by: mohtashims
22 Replies

9. Shell Programming and Scripting

Adding another option to getopt

I am trying to code for the addition of a new argument to the command line, the option D to a code that already has ABC (below). When I use make to compile it, it displays: invalid option --D. I did define the global d variable, as well as initialized it inside the main function of the C code. I... (9 Replies)
Discussion started by: Alabama
9 Replies

10. Shell Programming and Scripting

ksh - default value for getopts option's argument

Hello everyone, I need help in understanding the default value for getopts option's argument in ksh. I've written a short test script: #!/bin/ksh usage(){ printf "Usage: -v and -m are mandatory\n\n" } while getopts ":v#m:" opt; do case $opt in v) version="$OPTARG";; ... (1 Reply)
Discussion started by: da1
1 Replies
rt-email-group-admin(8) 				     Request Tracker Reference					   rt-email-group-admin(8)

NAME
rt-email-group-admin - Command line tool for administrating NotifyGroup actions SYNOPSIS
rt-email-group-admin --list rt-email-group-admin --create 'Notify foo team' --group Foo rt-email-group-admin --create 'Notify foo team as comment' --comment --group Foo rt-email-group-admin --create 'Notify group Foo and Bar' --group Foo --group Bar rt-email-group-admin --create 'Notify user foo@bar.com' --user foo@bar.com rt-email-group-admin --create 'Notify VIPs' --user vip1@bar.com rt-email-group-admin --add 'Notify VIPs' --user vip2@bar.com --group vip1 --user vip3@foo.com rt-email-group-admin --rename 'Notify VIPs' --newname 'Inform VIPs' rt-email-group-admin --switch 'Notify VIPs' rt-email-group-admin --delete 'Notify user foo@bar.com' DESCRIPTION
This script list, create, modify or delete scrip actions in the RT DB. Once you've created an action you can use it in a scrip. For example you can create the following action using this script: rt-email-group-admin --create 'Notify developers' --group 'Development Team' Then you can add the followoing scrip to your Bugs queue: Condition: On Create Action: Notify developers Template: Transaction Stage: TransactionCreate Your development team will be notified on every new ticket in the queue. USAGE
rt-email-group-admin --COMMAND ARGS COMMANDS
list Lists actions and its descriptions. create NAME [--comment] [--group GNAME] [--user UNAME] Creates new action with NAME and adds users and/or groups to its recipient list. Would be notify as comment if --comment specified. add NAME [--group GNAME] [--user UNAME] Adds groups and/or users to recipients of the action NAME. delete NAME Deletes action NAME if scrips doesn't use it. switch NAME Switch action NAME from notify as correspondence to comment and back. rename NAME --newname NEWNAME Renames action NAME to NEWNAME. NOTES If command has option --group or --user then you can use it more then once, if other is not specified. AUTHOR
Ruslan U. Zakirov <ruz@bestpractical.com> SEE ALSO
RT::Action::NotifyGroup, RT::Action::NotifyGroupAsComment perl v5.14.2 2013-05-22 rt-email-group-admin(8)
All times are GMT -4. The time now is 10:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy