Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi all,
I have two scripts that come were sent to me by a friend they start a database which he built for me.
On his system they run fine on my system I get the following errors.
[aamehl@bzq-218-14-208 nigun]$ ./nigunStart
: bad interpreter: No such file or directory
[aamehl@bzq-218-14-208 nigun]$
[aamehl@bzq-218-14-208 nigun]$ sh nigunStart
nigunStart: line 9: syntax error: unexpected end of file
[aamehl@bzq-218-14-208 nigun]$
this script runs another script
[aamehl@bzq-218-14-208 nigun]$ ./start
: bad interpreter: No such file or directory
[aamehl@bzq-218-14-208 nigun]$
[aamehl@bzq-218-14-208 nigun]$ sh start
'tart: line 24: syntax error near unexpected token `
'tart: line 24: `
[aamehl@bzq-218-14-208 nigun]$
the program being run is xindice an xml database.
He says that it works fine for him. I tried fiddling with permissions to no avail.
If someone has an idea I can send them the files to check.
Thanks
Aaron
Are these scripts in your "nigun" directory to be executed from? Are they executable? What kind of scripts are they, can you post one of them here, etc?
You don't have to remember cmod 755 or whatever. Just type 'man chmod' and it's all right there. Personally, 'chmod u+x' is a lot easier for me to remember.
[The nigunStart script:
aamehl@bzq-218-14-208 nigun]$ cat nigunStart
#!/bin/bash
export XINDICE_HOME=$(pwd)
export CP=$(pwd)/toren.jar
for i in ./lib/*.jar ;do export CP=$CP:$i ; done
for i in ./java/lib/*.jar ;do export CP=$CP:$i ; done
xterm -e ./start &
java -cp $CP toren.DataEntryApp
[aamehl@bzq-218-14-208 nigun]$
--------------------------------------
the start script
[aamehl@bzq-218-14-208 nigun]$ cat start
#!/bin/sh
if test -z "$XINDICE_HOME"; then
XINDICE_HOME=`dirname $0`
export XINDICE_HOME
fi
# Read in the list of Xindice Jars to include in the CLASSPATH
JARS=`ls -1 $XINDICE_HOME/java/*.jar`
for jar in $JARS
do
CLASSPATH=$jar:$CLASSPATH ;
done
# Read in the extra VM paramters for starting the program
VMPROPS=""
if test -f $XINDICE_HOME/config/vm.cfg; then
PROPS="`cat $XINDICE_HOME/config/vm.cfg`"
for prop in $PROPS
do
VMPROPS="$VMPROPS $prop"
done
fi
I'm pretty sure you have the DOS line ending problem.
I copied and pasted your nigunStart script into vi and saved it as nigunStart.unix. Naturally it has the normal Unix LF (line feed) to indicate line endings.
I ran it via ./nigunStart.unix and it ran; I got errors because I don't have the same setup as you, but it ran.
Then I made a copy of it with DOS CR LF endings (carriage return and line feed endings) via "todos < nigunStart.unix > nigunStart.dos".
Running the copy resulted in:
lyle@bowman:~/empty$ ./nigunStart.dos
: bad interpreter: No such file or directory
I also tried:
lyle@bowman:~/empty$ sh nigunStart.dos
nigunStart.dos: line 8: syntax error: unexpected end of file
This is exactly the behaviour in your original post.
To check what line ending convention a file has, use od -a. For example (I've highlighed what's important to notice in red, and we only need a few lines to see what we need to see):
lyle@bowman:~/empty$ od -a nigunStart.unix | head -2
0000000 # ! / b i n / b a s h nl e x p o
0000020 r t sp X I N D I C E _ H O M E =
and:
lyle@bowman:~/empty$ od -a nigunStart.dos | head -2
0000000 # ! / b i n / b a s h cr nl e x p
0000020 o r t sp X I N D I C E _ H O M E
You can use tr to get rid of the offending CR characters if you don't have the fromdos command (I used man ascii to figure out that CR is '\r'):
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.