![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| found error 138 while run shell script | rinku | Shell Programming and Scripting | 1 | 06-01-2008 11:29 PM |
| Shell script run error ksh: not found | nz80qy | Shell Programming and Scripting | 3 | 03-25-2008 07:57 AM |
| Installer script -- function not found error | asutoshch | Shell Programming and Scripting | 1 | 07-10-2006 11:07 AM |
| Newb question | daeglin | UNIX for Dummies Questions & Answers | 4 | 10-15-2004 02:24 AM |
| newb shell question | Fokus | Shell Programming and Scripting | 2 | 12-13-2001 11:08 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Newb scripting question, I get the error script not found
This is probably a really simple problem, but goes easy on me I'm still a newb. The problem I have is that a script (we'll call it script.script) I edited won't run for some reason, I get the error "ksh: script.script: not found"
The location of my script is as follows: /home/users/arkitech The actual script I'm running looks like this: [q] #!/bin/perl -w # ########################################################################## # NAME: script.script # SYNOPSIS: script provides daily monitoring of system activity & # disk usage ########################################################################## # DECLARE VARIABLES use strict; companyservername:/home/users/arkitech-> whence sendmail /usr/sbin/sendmail my @sar = qx(/bin/sar); my @space = qx(/bin/df -k /dev/vx/dsk/elephant_fs/p1* | grep -v "Filesystem"); my $to = 'arkitech@att.com'; # my $from = 'companyaddress@msg.ameritech.com'; my $date = scalar(localtime); my $fs; my $newfs; my $kbytes; my $used; my $avail; my $capacity; my $mounted; open(SENDMAIL, "|/usr/lib/sendmail -t ") or die ("Can't fork for sendmail daemon: $!\n"); print SENDMAIL "From: <",$from,">\n"; print SENDMAIL "To: ",$to,"\n"; print SENDMAIL "Subject: ODR daily capacity monitor\n"; print SENDMAIL "Reporting on ", $date, "\n\n"; print SENDMAIL "System Activity\n"; print SENDMAIL "-----------------\n"; print SENDMAIL @sar, "\n\n\n"; print SENDMAIL "Disk Usage\n"; print SENDMAIL "------------\n\n"; print SENDMAIL "Filesystem \t\tkbytes \tused \tAvailable\tcapacity\t Mounted on\n"; print SENDMAIL "------------------\t----------\t---------\t---------\t--------\t -------------------\n"; format SENDMAIL = @<<<<<<<<<<<<<<<<< @<<<<<<<<<< @<<<<<<<<<< @<<<<<<<<<< @<<<<<<<<<< @<<<<<<<<<<<<<<<<<< $newfs, $kbytes, $used, $avail, $capacity, $mounted . foreach (@space) { chomp; ($fs, $kbytes, $used, $avail, $capacity, $mounted) = split(/\s+/, $_); $newfs = substr($fs, 24); write SENDMAIL; } print SENDMAIL "\n\nEnd of Report.\n\n"; close(SENDMAIL) or warn ("sendmail didn't close nicely! $!\n"); [/q] Thanks for any help |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
My guess is that it can't find perl.
Do a 'which perl' and make sure you have the correct path listed in your script. It's normally not in /bin. It should be in /usr/bin or maybe even /opt. -X |
|
#3
|
||||
|
||||
|
Quote:
As an example, a simple script which just says "Hi". Quote:
|
|
#4
|
|||
|
|||
|
Thanks Indo, that's exactly what the problem was. I attempted to run the script using just the file name.
Thanks again for the help |
|||
| Google The UNIX and Linux Forums |