LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-17-2002, 01:34 AM   #1
adam_boz
Member
 
Registered: Jul 2002
Location: Santa Cruz, CA
Distribution: lfs
Posts: 538

Rep: Reputation: 30
compile within bash function?


Hi all. I am trying to write (what i thought was a simple) bash script which will install some packages. It works o.k., until it gets to the make command in the function.... then my computer locks up and when i get this:

fork: Resource temporarily unavailable

I looked that up and it seems that it's because i don't have enough virtual memory? that can't be though.... i have WAY too much. I guess it's something wrong with my syntax, but i can't figure out what. I can make functions w/ simple stuff like "echo $PWD" and what not, but this:

function bash {

cd bash-2.05a/
./configure --enable-static-link \
--prefix=$LFS/static --with-curses
make
make install
cd ..
}

Just doesn't want to work. I have played around w/ adding &&'s, ;;'s, break's and other stuff, but nothing works.

I origonally had this:

for i in $( ls | grep bash )
do
cd $i

instead of "cd bash-2.05a/", but that didn't even let me get to the configure script.

Anybody know what i am doing wrong?
Any help would be greatly appreciated. Thanks in advance

-Adam
 
Old 09-17-2002, 11:13 PM   #2
adam_boz
Member
 
Registered: Jul 2002
Location: Santa Cruz, CA
Distribution: lfs
Posts: 538

Original Poster
Rep: Reputation: 30
Well, I ended up getting it all to work, the latter problem was resolved with "done" after do cd $i. (instead of at the end of the function). I ended up doing "export <function>" after each one, and then calling them from an OPTIONS/select table.
 
  


Reply


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
how do i have scrolling function in bash? pyenos Linux - Software 3 03-09-2005 05:41 AM
Bash function pazvant Linux - Software 1 03-08-2005 07:47 AM
How do I add a function to Bash? Gag Halfrunt Linux - Newbie 5 11-25-2004 12:05 PM
bash random function NSKL Programming 6 02-02-2003 01:39 PM
stat function in BASH... PokerFace Programming 1 11-04-2002 11:31 AM


All times are GMT -5. The time now is 05:16 AM.

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