Thanks for the direction everyone. I now have expect loaded on my server, and will try to figure it out. Is there a way to use my existing script above, and only call the expect for the actual ssh part, or would it be better to write the entire thing with expect ? Sorry for the stupid...
Currently I'm using the script below only with TELNET instead of SSH and it works great. Trying to do the same type of thing with SSH, and can't seem to get it to login.
Please Help and newby out.
#!/usr/bin/ksh
# echo "Enter switch: \c"
# read switch
# echo "Enter username: \c"
# read...
I figured out the issue. Apparently the file I wanted to be included in the email can't have () or : in it. Once I removed those the script works fine.
...other script. The reason is I'm pulling the same data from several places at once ever 5 minutes.
CRON Entry
1,6,11,16,21,26,31,36,41,46,51,56 **** /export/home/scripts/get_mtxcper
cat get_mtxcper
/export/home/scripts/mtxcper STLOMTX &
cat mtxcper
#!/usr/bin/ksh
# echo "Enter switch...
/usr/lib/sendmail -v -f "ALERT" email@address.com < ALERT.txt
I only get 1 email when I do this, however I only see ALERT in the sender information. No information from the ALERT.txt file is included.
I was including the if statement at the end of a cron that runs every five minutes...
percent='99'
percent is small
before send
email@address.com... Connecting to corpmta.com. via relay...
220 wimidd01-smtp-01-internal.com ESMTP
>>> EHLO ilscha01-nsweng-01.com
250-wimidd01-smtp-01-internal.com
250-8BITMIME
250 SIZE 16777216
>>> MAIL From:<ALERT@ilscha01-nsweng-01.com> SIZE=36
250...
It seems to be working as far as the if portion, however it this is in a KSH script.
When it meets the criteria of the if statement I get several emails in a row with nothing in them other then ALERT as the subject.
if (( $(< PERCENT_ALERT.txt ) <= 100 )); then
/usr/lib/sendmail -v -f "ALERT"...
Better explanation is if the value in the PERCENT_ALERT.txt file is less than or equal to 100 then send an email with the text of a different file.
Hope that makes sense.
Thank you. That worked good.
What if one of the items was "escargo" ?
I would only want the items that end with "es" not anything with es in it. Is there a way to do that ?
Here is what I got when I replaced Durian with escargo.
Total value of White Peaches on hand = $285
Total value of...
..."$a\n";
print "$b\n";
print "$c\n";
print "$d\n";
The above shows
22
-1
-1
23
I'm supposed to search each line that is != 1 and print that line like such. Without using prior knowledge that $a and $d will work.
print "Total value of $item on hand = \$", $cost * $quantity, "\n";
Please...
I have the following:
/usr/bin/tail
/usr/xpg4/bin/tail
/usr/ucb/tail
Trying to make it work interactively , however the goal will be Cron.
For some reason it is putting all the text in the new file all together. Example
First file.
BOB
GEORGE
JEFF
GREG
BILLY
Second file after tail...
I have a KSH script that is working great on Solaris 10 Sparc, however I FTP this script to a different machine running Solaris 9, and now the #.LIVE.txt output is garbage when viewing from Web Browser. The original file shows fine, so it seems to be an issue with my Tail +15. I'm so confused...
Actually it works, however I noticed that there is garbage on the first line of the output. It doesn't show up when I cat the file, but when I link to the file from a webpage it shows up as garbage. Any suggestions as to why ?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.