Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am wondering if there is any size, length or even run-time limitations with bash scripts. I am installing php-hiphop on debian squeeze(I know it's not ubuntu but I presumed there were some bash experts hanging around here) on a test server, and there is quite a lot of extra libraries and configuring to do before even attempting to compile hiphop so I plan to make a bash script so that updating other servers will be quicker. I'm pretty new to linux systems, this is actually my first time properly using one, and I have no idea how much or how little bash files can do.

As an example, I have to update gcc to 4.6 which at the make command is taking 5+ hours, and was wondering even after that long will the bash script be able to continue? I have also noticed one can use multiple bash scripts and use wait to wait for a command to finish then execute another script, would this be a better approach?

Thanks in advance.

share|improve this question
    
Size limit? lol If you have a bash file that's over a megabyte in size, then you'd probably be better off using a real programming language. Though, a bash script could be way over 100 megabytes in size if you really want to know. :) –  Sepero Oct 24 '12 at 15:18
    
Ha I should have phrased that better. I suppose size is the wrong word here, I mean "amount of commands" or something like that. –  boundless08 Oct 24 '12 at 15:32
    
If the command you want will work in the terminal, then it will work in a bash script. As for the number of commands- I suppose that is only limited by your hardware. –  Sepero Oct 24 '12 at 15:38
    
Thanks Sepero, really helps. I'll let you know how my 4.76GB bash file went when I finish running it :P –  boundless08 Oct 24 '12 at 15:45
add comment

1 Answer

up vote 3 down vote accepted

I have never run into limitations on size or time, and as long as your script isn't hampering the system in some way-there is no limitation.

I have a script that backs up all my servers to a network location, it runs for 19 hours. as far as sizes? scripts are only text files, how big could it get? bash scripting a great because of its few limitations, enjoy!

hope this answers your question!

thanks jm

share|improve this answer
1  
Thanks that really helps. I don't mean size as in memory, although I should have phrased it better, I kind of meant it as number of commands, as in "the size of what it does". I swear it makes sense in my head. –  boundless08 Oct 24 '12 at 15:31
    
oh, well that shouldn't matter either, my back up script is about 60 commands. 1 create backup, 2 move backup, 3, verify.. then repeat for 20 servers. good luck scripting! –  jmartin2279 Oct 25 '12 at 8:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.