Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 09-17-2002, 02:34 AM   #1
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 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 )
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

Old 09-18-2002, 12:13 AM   #2
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.


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

All times are GMT -5. The time now is 04:02 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