Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-28-2005, 12:01 PM   #1
LQ Newbie
Registered: Feb 2005
Posts: 2

Rep: Reputation: 0
Basic Shell Script Help


first i would like to say this site has been a wealth of information since i have been trying to get to grips with linux FC3!

i am trying to write a basic script to excute several commands.

What i have is this:

java antlr.Tool lex.g
java antlr.Tool syn.g
java antlr.Tool sem.g
java antlr.Tool irt.g
java antlr.Tool cg.g
javac *.java
java camle -syn test0.le

basically if i enter this commands in the terminal they all work so i know i have everything setup but when i run the script the only command to work is the last one "java camle -syn test0.le"
the top ones say "lex.g" file not found! etc, plus the compile all java command doesn't work either!

i have tried entering the full path but that doesn't work either.

basically i want this script as when i make any changes to any of the above files i have to type in all these commands and a script to do it would be much easier, but at the moment i am spending more time trying to get the script working!


Last edited by Vasquez; 02-28-2005 at 12:02 PM.
Old 02-28-2005, 01:31 PM   #2
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Are you running it from the same directory as otherwise? Try changing the /bin/bash line to read '#!/bin/bash -x': this will generate some debug output that will be useful.
Old 02-28-2005, 07:01 PM   #3
LQ Newbie
Registered: Feb 2005
Posts: 2

Original Poster
Rep: Reputation: 0
opps feel a bit stupid now!

from using the -x option i could see that becuase i wrote the script in gedit that it was reading carridge retuns as part of the commands.

I just opened it in vi and sorted it!

Thanks for your help though and the -x tip!
Old 02-28-2005, 07:14 PM   #4
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 128Reputation: 128
No problem. I learned that -x tip a while back with a similar mistake... $I and $i are not quite the same thing.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM
Help with basic bourne shell script rnj Programming 6 09-13-2005 08:41 PM
basic shell script help lin00b Linux - Newbie 2 10-08-2004 11:32 PM
Basic shell script, please help colly Linux - General 4 10-05-2004 11:24 AM
basic shell script help coyote399 Linux - Newbie 6 04-14-2004 09:22 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:25 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration