Sponsored Content
Top Forums Shell Programming and Scripting Newb scripting question, I get the error script not found Post 302072479 by Arkitech on Wednesday 3rd of May 2006 10:59:51 AM
Old 05-03-2006
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
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

newb shell question

I know this is a total begginer question but what is wrong with this picture. My loop wont loop, it just drops me back to the prompt and gives the error "unary operator expected". Any help would be appreciated. here it is, #!/bin/sh selection= while do cat << MENU 1)List files in... (2 Replies)
Discussion started by: Fokus
2 Replies

2. UNIX for Dummies Questions & Answers

Newb question

I don't even know if this should go here but I just would like to know what this means: d0e45878043844ffc41aac437e86b602 I know absolutely nothin' about UNIX, and I found this in a SQL table in a board I run. Someone please tell me what that is in "normal" mode. Pardon me for my... (4 Replies)
Discussion started by: daeglin
4 Replies

3. Shell Programming and Scripting

Another newb question: how to use test for zero-length string ?

Assume $x equals "". If I try: if test -n $x I get the "Expression syntax" error. It works in Linux but not in unix bash. In unix bourne I get "test: argument expected" (4 Replies)
Discussion started by: lumix
4 Replies

4. Shell Programming and Scripting

Newb with While loop question

My first post here.... I have a few years exp with linux distros and some very basic Python..Ive been intent on learning shell scripting the last few weeks. Please excuse my crude efforts. I am running a program that takes network data containing US city names in plain text. I am TRYING to... (7 Replies)
Discussion started by: dddkkk
7 Replies

5. Shell Programming and Scripting

getting the error 'not found' while executing the script

Hi, I am not able to figure out what the problem is: getting the following error sqltst.sh: 1: not found here is the script #!/bin/sh . /home/dev1/.profile . /home/dev1/.infenv `sqlplus -s $REPDB_LOGON << EOF SET SERVEROUT ON SET FEEDBACK OFF SET HEADING OFF SET TRIMSPOOL... (4 Replies)
Discussion started by: svajhala
4 Replies

6. UNIX for Dummies Questions & Answers

Newb writing his first shell script

Hey! This is my first post on this forum, nice to meet ya! I've been using Linux for a good few years, I grew up using DOS and a few similar CLI-based OS's so I'm fairly okay with navigating my way around the terminal. Recently I decided I wanted to become a sysadmin so I've been teaching... (3 Replies)
Discussion started by: Tamachan87
3 Replies

7. Shell Programming and Scripting

newb at scripting how would I do this?

Hi guys. I have been lurking for quit some time attempting to learn on my own but I have reached an impasse. I need to extract specific details from from a text file that I get and parse it out into separate files with the name of each individual and the date it was proccess. Then within... (2 Replies)
Discussion started by: lostpacket
2 Replies

8. Shell Programming and Scripting

Newb question about getting a word from a text file

Hi everyone. I am new to shell scripting and have been looking at quite a few web pages to try and figure this out, but to no avail. What I am trying to do is get a value from a text file that contains a paragraph of information.. Something similar too: Welcome to random script You are... (1 Reply)
Discussion started by: elemenopee
1 Replies

9. UNIX for Dummies Questions & Answers

NEWB Question - BASH COMMAND RESULT for ${0##*/}

This should be extremely simple and someone will probably answer it in .5 seconds. I need to know what: VARIABLE=${0##*/} does? I do not have a shell handy to just try it in. I am reading through some scripts and need to understand this line. Any help is appreciated. Many thanks! -... (3 Replies)
Discussion started by: chrisgoetz
3 Replies

10. Shell Programming and Scripting

+: not found Error in shell script

Hi , I am a newbie to shell scripting. I am getting the error on AIX machine /tadfdc_setup_fed.sh: +: not found Here tadfdc_setup_fed.sh is script which works fine on Linux Machine. But gives error on AIX (1 Reply)
Discussion started by: Anupam Kakade
1 Replies
POLLRCVD(8)						      System Manager's Manual						       POLLRCVD(8)

NAME
pollrcvd - HylaFAX script for delivering facsimile received by polling SYNOPSIS
/var/spool/hylafax/bin/pollrcvd mailaddr faxfile devid commid error-msg DESCRIPTION
bin/pollrcvd is the command script invoked by the HylaFAX server whenever a facsimile is received as a result of a polling operation. The default script uses electronic mail to deliver the facsimile to the user that submitted the poll request, and can be controlled by editing the etc/PollDispatch shell script in the spooling area that is sourced by pollrcvd when it runs. The arguments are: mailaddr the electronic mail address of the user that submitted the poll request. faxfile the pathname of the received TIFF file relative to the root of the spooling hierarchy. commid The communication identifier associated with the call (used to include a transcript when an error occurs). devid the modem device on which the document was received. error-msg an error message that is non-null if an error was encountered during the receive operation. NOTES
The default script delivers facsimile as PostScript wrapped in MIME. FILES
/var/spool/hylafax spooling area /usr/sbin/faxinfo for printing information about the facsimile /usr/bin/fax2ps for converting TIFF to PostScript /usr/lib/sendmail for delivering mail SEE ALSO
faxq(8), hylafax-server(5), recvq(5) May 12, 1996 POLLRCVD(8)
All times are GMT -4. The time now is 04:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy