Help with a short script

H54

Member
Jan 16, 2011
187
0
71
Can anyone take a look at this and tell me what I'm doing wrong?

I want to create an 'at' job that sends me a reminder. If I'm online, echo to terminal, else, email to myself.

For some reason, the email portion will not work.

##


1 #!/usr/dt/bin/dtksh
2
3 status=`finger | grep -c $USER`
4 terminal=`tty | cut -d/ -f4`
5
6 at $1 $2 $3 <<!
7
8 if "$status" -ge 1
9 then
10 echo $* > /dev/pts/$terminal
11 else
12 echo $* > elm -s Alert name@someemail.com;
13 endif
14 !
15
16 exit
 

Fallen Kell

Diamond Member
Oct 9, 1999
6,249
561
126
Figure I would start with the basics:

elm [-a] [-c] [-dn] [-fx] [-h] [-k] [-K] [-m] [-sx] [-V] [-v] [-w] [-z]

*Before elm can be ran an elm configuration file .elm file must be on the root or root of the user profile.
 

H54

Member
Jan 16, 2011
187
0
71
Thanks for the response. Elm is set up as I've been using it for a while. I finally got the script working but I had to create a new file with pretty much identical code. I think there is something funky going on with the server.