[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
./<script> "not found" as BASH, but is as SH ????
From: |
Marcello M. Pavan |
Subject: |
./<script> "not found" as BASH, but is as SH ???? |
Date: |
Fri, 26 Jan 2001 16:49:54 -0800 |
Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu'
-DCONF_VENDOR='redhat' -DSHELL -DHAVE_CONFIG_H -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -I. -I. -I./include -I./lib -I/usr/include -O2
-march=i386 -mcpu=i686
uname output: Linux koslx2.triumf.ca 2.4.0 #5 SMP Thu Jan 25 10:13:07 PST 2001
i686 unknown
Machine Type: i386-redhat-linux-gnu
Bash Version: 2.04
Patch Level: 11
Release Status: release
Description:
^^^^^^^^^^^^
A BASH shell script (e.g. autofs) will NOT execute by doing
./<script> [options] in the directory it resides.
root@koslx2::/usr/bin (<--- n.b. any directory but /root will do)
>./myautofs status
./myautofs: ./myautofs: No such file or directory
>head myautofs
#!/bin/bash
#
# $Id: rc.autofs.in,v 1.4 2000/01/22 22:17:34 hpa Exp $
HOWEVER!!! it WILL WORK by merely changing the first line to
#!/bin/sh (rather than #!/bin/bash) ?????
root@koslx2::/usr/bin
>./myautofs~ status
Configured Mount Points:
------------------------
/usr/sbin/automount /kos yp auto.kos rw,hard,suid,intr,rsize=8192,wsize=8192
/usr/sbin/automount /fserver yp auto.fserver ro,soft,intr,rsize=8192
Active Mount Points:
--------------------
/usr/sbin/automount /kos yp auto.kos rw,hard,suid,intr,rsize=8192,wsize=8192
/usr/sbin/automount /fserver yp auto.fserver ro,soft,intr,rsize=8192
root@koslx2::/usr/bin
>head myautofs~
#!/bin/sh
#
This is crazy since in my system BASH and SH are the SAME THING !
>ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Jan 19 13:06 /bin/sh -> bash
Plus, it WILL work as a BASH script if I run it in the /root directory,
but nowhere else.
root@koslx2::~
>./myautofs status
Configured Mount Points:
------------------------
/usr/sbin/automount /kos yp auto.kos rw,hard,suid,intr,rsize=8192,wsize=8192
/usr/sbin/automount /fserver yp auto.fserver ro,soft,intr,rsize=8192
Active Mount Points:
--------------------
/usr/sbin/automount /kos yp auto.kos rw,hard,suid,intr,rsize=8192,wsize=8192
/usr/sbin/automount /fserver yp auto.fserver ro,soft,intr,rsize=8192
root@koslx2::~
>head myautofs
#!/bin/bash
#
# $Id: rc.autofs.in,v 1.4 2000/01/22 22:17:34 hpa Exp $
#
What on earth is going on here ?? Because of this, my /etc/init.d/network
script crashes since the BASH script ./ifup in /etc/sysconfig/network-scripts
is "not found" ???
The scripts and the directories have the correct permissions.
Repeat-By:
^^^^^^^^
Get any BASH script and try ./<script> in a directory like /, /etc/ ,
but NOT /root (it works there).
Fix:
^^^^
That is where you come in ???
hope you can help, this is driving me batty.
best regards,
marcello pavan
p.s. output of shopt
root@koslx2::/usr/bin
>shopt
cdable_vars off
cdspell off
checkhash off
checkwinsize off
cmdhist on
dotglob off
execfail off
expand_aliases on
extglob off
histreedit off
histappend off
histverify off
hostcomplete on
huponexit off
interactive_commentson
lithist off
mailwarn off
no_empty_cmd_completionoff
nocaseglob off
nullglob off
progcomp on
promptvars on
restricted_shelloff
shift_verbose off
sourcepath on
xpg_echo off
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- ./<script> "not found" as BASH, but is as SH ????,
Marcello M. Pavan <=