You said that the value of "$SHELL" is "/bin/bash" somewhere up in this thread. You also said, that "which bash" gives the same output, "/bin/bash". Am i correct so far?
Because if i am, i don't understand the "bad interpreter" error message. It looks like the script is unable to load a new instance of /bin/bash to execute the script in it, but the location is the same as indicated by the value of "$SHELL" and the which command.
Please run the following command from the commandline and post the output here:
Additionally please post the line of the file /etc/passwd for root. One of the fields in this file is the login shell for the user and in your case, assuming your user is "root", it should look similar to that:
If it is not "/bin/bash" we know at least why the "bad interpreter" message comes from.
It might - as a remote chance - be that the file is either corrupted or a link to some other file which i would like to find out with the other commands. It might - also a remote chance - be that there is something overmounted via NFS (in this case you are in really deep kimchi), so please post the output of the "mount" command.
A problem is not solved when the symptom had gone away. A problem is solved only when it is fully understood what led to it in first place. (This is one of the more awful cognitions gained in 30 years spent in IT business.)
You said that the value of "$SHELL" is "/bin/bash" somewhere up in this thread. You also said, that "which bash" gives the same output, "/bin/bash". Am i correct so far?
Because if i am, i don't understand the "bad interpreter" error message. It looks like the script is unable to load a new instance of /bin/bash to execute the script in it, but the location is the same as indicated by the value of "$SHELL" and the which command.
Please run the following command from the commandline and post the output here:
Additionally please post the line of the file /etc/passwd for root. One of the fields in this file is the login shell for the user and in your case, assuming your user is "root", it should look similar to that:
If it is not "/bin/bash" we know at least why the "bad interpreter" message comes from.
It might - as a remote chance - be that the file is either corrupted or a link to some other file which i would like to find out with the other commands. It might - also a remote chance - be that there is something overmounted via NFS (in this case you are in really deep kimchi), so please post the output of the "mount" command.
I hope this helps.
bakunin
Here's the output from the commands you gave above:
98169 -rwxr-xr-x 1 root root 626028 Feb 11 2003 /bin/bash
/bin/bash: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), stripped
Here's the output from the commands you gave above:
98169 -rwxr-xr-x 1 root root 626028 Feb 11 2003 /bin/bash
/bin/bash: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), stripped
root:x:0:0:root:/root:/bin/bash
Ok, this all looks good. /bin/bash looks like it is the executable it is supposed to be. I don't understand why the first line of the script, which should be:
leads to an error. Have you checked there are no special characters in it or after it? Try to retype the first line of the script. There should be no characters left from the text (that is, the octothorpe "#" has to be the first character on the line) and there should be no characters trailing.
You wrote that it worked now. What exactly have you done to make it work?
Ok, this all looks good. /bin/bash looks like it is the executable it is supposed to be. I don't understand why the first line of the script, which should be:
leads to an error. Have you checked there are no special characters in it or after it? Try to retype the first line of the script. There should be no characters left from the text (that is, the octothorpe "#" has to be the first character on the line) and there should be no characters trailing.
You wrote that it worked now. What exactly have you done to make it work?
bakunin
When I tested the script you provided and moved FILE.1 FILE.2 FILE.3 to dir3, that worked. I don't know why. But I just left it (with the spaces in between the line) and it worked.
I had retyped and retyped the entire scripts many times and it didn't work, but I didn't retype yours, just cut and paste and that worked.
Hello.
From a script, a command for a test is use :
find /home/user_install -maxdepth 1 -type f -newer /tmp/000_skel_file_deb ! -newer /tmp/000_skel_file_end -name '.bashrc' -o -name '.profile' -o -name '.gtkrc-2.0' -o -name '.i18n' -o -name '.inputrc'
Tha command... (3 Replies)
Hi all,
Forgive me for asking for help with my first post, but I am struggling here. I've been asked to translate a bash script into a Windows script (probably batch or powershell, not sure yet), so the first step is obviously understand what the bash script is doing. But I have no experience in... (5 Replies)
I have the following bash script lines in a file named test.sh.
#!/bin/bash
#
# Write Date to cron.log
#
echo "Begin SSI Load $(date +%d%b%y_%T)"
#
# Get the latest rates file for processing.
#
d=$(ls -tr /rms/data/ssi | grep -v "processed" | tail -n 1)
filename=$d
export filename... (3 Replies)
Hi,
I have the following lines in a script :
.
.
exec < some_file
.
.
.
I have very little idea about exec command. I would like to know what this does and what will happen if the file some_file does not exist. Specifically, I would like to know whether the lines following this... (5 Replies)
Hi can some one explain the following command , It would really help if some can really elloborate on what is happening out here
export PATH | exec /bin/sh ./auto_approve :q
P.S: This is the first time i am using exec ,so an elloboration what does it do and what is the use of the :q will be... (1 Reply)
How can I use the exec command to log my korn shell session to the screen and the log file?
Currently I have this command:
$exec 1> ${LOG} 2>&1
This logs the output to the log file only. I want it to go to the screen also. Is this possible with this command?
thanks. (10 Replies)
All,
I am using below shell script to output the content to outputfile.txt. What I am looking for is in addition to outputfile.txt, I want the output to be on standard output too.
exec > outputfile.txt
echo "Starting "
echo "ending" (5 Replies)
hai
i want know the difference between two shell scripts those are
1)
a=2004
echo $a #output------2004
exec < inputfile
while read line
do
echo $a #output-------2004
a=2005
echo $line
echo $a ... (1 Reply)
linux redhat 8.0
I am getting accustomed to using the -exec command to get around my databse.. and use it to edit and update files..! is this more apllicable than jumping from one directory to the other.. I have set up the databse so that the inode #'s are accessable and can get me from one... (0 Replies)