Mailing List
Home
Forum Home
Linux - General Red Hat Linux discussion list
Enterprise Linux 3 - Discussion of Red Hat Enterprise Linux 3 (Taroon)
Installation - Getting started with Red Hat Linux
Red Hat Linux 9 - Discussion of Red Hat Linux 9 (Shrike)
Red Hat Linux 7.3 - Discussion of Red Hat Linux 7.3 (Valhalla)
Red Hat Linux 7.2 - Discussion of Red Hat Linux 7.2 (Enigma)
Apache Web Server
Oracle database, Microsoft SQL server ...
Subjects
application/x mplayer2 plugin
RPM error: db4 error(16) from dbenv >remove: Device or resource
   busy
Command stream end of file while reading
X Windows problem (xauth)
Upgrading openoffice 1 1 rpm
FTP: connection refused
FTP: connection refused
mount: /dev/cdrom: is not a valid block device
Dell Precision 650, RedHat 9, no sound
how to trace the cause resulting in the crash of bind server
Virus on the list
UNINSTALL RPM MYSQL
usb pen drives: mounting as a user
broadcom network interface
make mrproper
sendmail configuration on redhat
Couldn 't open PID file /var/run/named/named pid Permission denied
Promise 378 controller
kernel 2 6 and /dev/sound/mixer not found
Problem using up2date
mrtg step by step howto/configuration for a newbie?
Compiling and Installing Kernel 2 6
Can 't locate module ppp0, can 't locate module ppp compress 21
HOW I CAN MAKE BOOTABLE FLOPPY DISKET
Lotus Notes under Wine
/etc/security/limits conf question
Intel E/1000 driver
Command stream end of file while reading
rpm database corrupt
qla2300 modules
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
confounded by a simple shell script

confounded by a simple shell script

2003-04-22       - By Scott Queen

 Back
Reply:     1     2     3  

All,
I'm using RHL 7.3, and I've got a couple of very simple shell scripts -
one of which is kicking my butt.  I just don't understand what it
is/isn't doing.

Here are the details
====================================
Script that works fine:
dokimos_web:logs>more combQV.sh
cp qvcatering_access.log qvcatering_access.log.bak
for i in `ls -rt qvcatering_access_log.2*.log`; do cat $i >>
qvcatering_access.log; done
mv qvcatering_access_log.2*.log saved
===========================================
Script (computeStats.sh) that doesn't work and it's output (Version 1):

# set environment variables
./home/dokimos_web/.bash_profile
#  TC defined in .bash_profile file
echo $TC  
exit 0
-- ---- ---- ---- ---- ---- ------
results:

dokimos_web:logs>./computeStats.sh
: No such file or directoryokimos_web/.bash_profile

'/computeStats.sh: exit: bad non-numeric arg `0
dokimos_web:logs>

[note: the apparent truncation/overwriting in the "No such file or
directoryokimos_web" line is not a typo on my part - that's the actual
output]


=================================================
Script (computeStats.sh) that doesn't work and it's output (Version 2):

#!/bin/bash
# set environment variables
./home/dokimos_web/.bash_profile
echo $TC
exit 0
-- ---- ---- ---- ---- ---- --
results:
dokimos_web:logs>./computeStats.sh
bash: ./computeStats.sh: bad interpreter: No such file or directory
dokimos_web:logs>

===========================================
I've checked, and bash is in /bin.

So.... I have a couple of questions:
1.  why isn't the #!/bin/bash line required in the script that works?
2.  why doesn't the other script work? [note that computeStats.sh has
executable permissions for all users]

Thanks,
Scott


__ ____ ____ ____ ____ ____ ____ ____ ____ ____ __
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com





Earn $52 per hosting referral at Lunarpages.