Whats the difference between Linux and Ubuntu when it comes to bash scripting?
Is one better than the other? Bash scripting in Ubunu is something new for me and I kind of like it. Its similar to programming, in a sense. I have not had the opportunity to perform bash scripting in Linux. It seems like once you learn the commands and how too use them, it becomes easier to bash script.
|
Ubuntu is Linux distribution. Linux is kernel.
bash is the same for any distro. shell scriptiong can be different for different shells. |
Quote:
Bash shell scripting is same on all linux distributions. |
Quote:
As UNIX/Linux shells have evolved they have gained more programming facilities and are now quite sophisticated in their own right -- functions, recursion, arrays, conditionals, string-manipulation, command output substitution ... and some once external commands have been built in for performance (test and echo are good examples) but bash can use all available commands in a more integrated way than other languages do with their "system" functions. So yes -- bash scripting is very "similar to programming" and the more "you learn the commands and how too use them", the more you can do with bash scripts. Beware bash' weaknesses though -- as always it's "horses for courses". Bash is slow at handling large strings and bash has to create a new process to run each external command which is quite slow and expensive in system resources. EDIT: Regards ubuntu/Linux, as has already been pointed out, ubuntu is a Linux-based product and bash is more-or-less identical wherever you find it. One difference not mentioned is that not all Linux-based "distros" have the same commands and, even if they do have the same commands, the format of output from those commands may be different. This makes it non-trivial to make "portable" bash scripts that can be run without change on a wide variety of systems. |
Hi,
Welcome to LQ! 'bash' is very useful to any user that really wants control of their system or perform maintenance on a UNIX or GNU/Linux system. Quote:
Code:
sample .bash_profile; Code:
sample .bashrc; Just a few useful links; Linux Documentation Project Rute Tutorial & Exposition Linux Command Guide Bash Reference Manual <<<<<<< Great & Useful Advanced Bash-Scripting Guide <<<<<<<< Very helpful Linux Newbie Admin Guide LinuxSelfHelp Getting Started with Linux The above links and others can be found at 'Slackware-Links' . More than just SlackwareŽ links! |
Quote:
|
All times are GMT -5. The time now is 03:42 PM. |