Getting error in shell scripts


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Getting error in shell scripts
# 1  
Old 07-16-2010
Getting error in shell scripts

Hi,
I have a shell script confug-msys.sh which callls config-common.sh. When run from command prompt,these work fine but give the below error when i try to run from code-blocks
line 7: --without-contrib: command not found

...Also I am unable to understand what the second script does...
Please help

Configure-msys.sh
Code:
#!/bin/sh
root=$(echo $0|sed 's#extras/package/win32/configure-msys.sh##')./
if [ -n "$1" ]
then
CONTRIBS="$1"
else
CONTRIBS="/usr/win32"
fi
export CONTRIBS
PATH="$CONTRIBS/bin:$PATH" \
PKG_CONFIG_LIBDIR=$CONTRIBS/lib/pkgconfig \
CPPFLAGS="-I$CONTRIBS/include -I$CONTRIBS/include/ebml" \
LDFLAGS="-L$CONTRIBS/lib" \
CC=gcc CXX=g++ \
CONFIG="${root}configure --host=i586-mingw32msvc --build=i386-linux
--disable-mkv --disable-taglib --disable-nls --disable-dirac --enable-debug" \
sh ${root}extras/package/win32/configure-common.sh

configure-common.sh
Code:
if [ -z $CONTRIBS ]
then
CONTRIBS=/usr/win32
fi
$CONFIG \
--without-contrib \
--enable-update-check \
--enable-lua \
--enable-faad \
--enable-flac \
--enable-theora \
--enable-twolame \
--enable-quicktime \
--enable-real \
--enable-avcodec --enable-merge-ffmpeg \
--enable-dca \
--enable-mpc \
--enable-libass \
--enable-x264 \
--enable-schroedinger \
--enable-realrtsp \
--enable-live555 --with-live555-tree=$CONTRIBS/live.com \
--enable-dvdread --with-dvdnav-config-path=$CONTRIBS/bin \
--enable-shout \
--enable-goom \
--enable-caca \
--enable-portaudio \
--enable-sdl --with-sdl-config-path=$CONTRIBS/bin \
--enable-qt4 \
--enable-mozilla --with-mozilla-sdk-path=$CONTRIBS/gecko-sdk \
--enable-activex \
--enable-sse --enable-mmx \
--enable-libcddb \
--enable-zvbi --disable-telx \
--disable-dvb \
--disable-sqlite \
--enable-peflags

# 2  
Old 07-16-2010
This is a script that configures some software package right before compiling. The common used configure options are outsourced into a second script.
--without-contrib is just the 1st parameter in the option list for the configure.

Quote:
when i try to run from code-blocks
I do not understand what this sentence means, but you should check out the documentation of this software and read it carefully. If nothing special is needed, you can often get around with a
Code:
./configure
./make
./make install

But as said, you should try to know what you downloaded, if it is for your OS and version and if you are starting to configure/compile it, when you are currently in it's base directory.
# 3  
Old 07-16-2010
To run from code-blocks i simply need to put the sh command in pre/post build steps ...which I have for config-msys.sh

But why the error:
Code:
line 7: --without-contrib: command not found

Moderator's Comments:
Mod Comment Use code tags also for error output, data, logs etc., ty.

Last edited by zaxxon; 07-16-2010 at 10:20 AM.. Reason: code tags
# 4  
Old 07-16-2010
With sh you start a new shell that does not know what $CONFIG is. $CONFIG contains your command to configure in the former shell where the parent script is started.
So starting the 2nd script on it's own will have an empty $CONFIG and it will run into
Code:
line 7: --without-contrib: command not found

because this is taken out of relationship from the former shell script. This is no command for a shell. It makes only sense in a context which you removed by adding the sh in front of the substitution of that
Code:
${root}extras/package/win32/configure-common.sh

If you want to run just the configure with the options, check what the $CONFIG contains or should contain and add it into the 2nd script when trying to call it alone, if that makes sense. Also exporting things to the second script would be a way but not very pretty and maybe not necessary.
This User Gave Thanks to zaxxon For This Post:
# 5  
Old 07-19-2010
Thanks...But this script works perfectly ok when ran from command prompt..
then what cld be missing from code blocks?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell scripts error

Dear all I have shell script where files have been organized into directory, i pass the directory name and it shold pick all the files within the directory and move to differnet path. When i run the scripts it doesn't move and come out with error and i am not able to understand it the... (2 Replies)
Discussion started by: guddu_12
2 Replies

2. Shell Programming and Scripting

calling 'n' number of shell scripts based on dependency in one shell script.

Hello gurus, I have three korn shell script 3.1, 3.2, 3.3. I would like to call three shell script in one shell script. i m looking for something like this call 3.1; If 3.1 = "complete" then call 3.2; if 3.2 = ''COMPlete" then call 3.3; else exit The... (1 Reply)
Discussion started by: shashi369
1 Replies

3. Shell Programming and Scripting

Advanced error handling in shell scripts

Hi all I've got a question regarding error handling in shell scripts. My background is mainly object oriented programming languages, but for a year or so I've been doing more and more (bash) shell scripting (which I quite enjoy by the way). To handle errors in my scripts I... (3 Replies)
Discussion started by: script_man
3 Replies

4. Shell Programming and Scripting

Error Checking in Shell scripts.

What i need to do is when the database connection is not successful , the script should move to next list i.e skip the current. But when i do this - if ; then break; fi The script break but it goes to the condition - if ; then for LIST in $LISTS do for TABLE in $TABLES do... (2 Replies)
Discussion started by: dinjo_jo
2 Replies

5. HP-UX

Shell Scripts

I have a text file . Format of text file. djss:xd:78:isdev:"test server" this type of row. (approx 30). I want to display like that 1. djjs@msxd testserver 2. xjfd@msxd devserver 3. 4 select any one from above choice : 1... (5 Replies)
Discussion started by: rastogideepak
5 Replies

6. Shell Programming and Scripting

Need Help With Shell scripts

Hello, I'm very very fresh with unix, and I would like to get familiar with it. I want to know what is Shell scripting and how other programming languages connects with it. And is there any way to learn the shell scripting, with some book and some simulator to practice on. Thanks ahead. (2 Replies)
Discussion started by: holler1
2 Replies

7. AIX

Difference between writing Unix Shell script and AIX Shell Scripts

Hi, Please give me the detailed Differences between writing Unix Shell script and AIX Shell Scripts. Thanks in advance..... (0 Replies)
Discussion started by: haroonec
0 Replies

8. Shell Programming and Scripting

shell scripts help

Hi, I am not experienced in shell scripts, I hope someone can give some hint for the following problem I have html file like this <html> <body> Some stuff More stuff <pre> A B </pre> Still more stuff And more <pre> C D </pre> Additional stuff </body> (2 Replies)
Discussion started by: ccp
2 Replies

9. UNIX for Advanced & Expert Users

Error Handling in Korn Shell scripts

Hi, I am using few ISQL statements to update and delete from a few tables in sybase, now i want to roll back the transaction when any of the statements fail.How i can i capture these errors in the shell scripts.Please advise. Thanks, Gopi (4 Replies)
Discussion started by: bhgopi
4 Replies

10. Shell Programming and Scripting

shell scripts

Hi! I have added a line into /etc/profile which looks like- date > $HOME/.lastloggedon This puts a file lastloggedon into everyones directory who has logged in recently. The trouble I am having is getting the information back out. I was hoping there was a command using find which brought... (1 Reply)
Discussion started by: karenshaw
1 Replies
Login or Register to Ask a Question