I'm looking to switch from bash to zsh but concerned about compatibility of bash scripts.
Are all bash scripts/functions compatible with zsh? Therefore, if that is true is zsh just an enhancement to bash?
I've learnt the basics of programming in bash.
Possible Duplicate:
How do I handle switches in a shell script?
Most common shell commands allow the user to specify options in any random order. Positional Parameters like $1 as commonly used in bash (I tend to write all my scripts in Bash but I don't think this question is actually Bash specific) scripts on the other hand, are order specific.
I've been using the following regex below in a bash script on RHEL 5.5 using version
GNU bash, version 3.2.25(1)-release
I've tried using the script on RHEL 6.3 which uses GNU bash, version 4.1.2(1)-release
I assume there's been alot of changes to bash since that's quite a jump in revisions.
How can I find out whether a script is written in bash or sh?
The first line of the script is not helpful here, since on Linux, bash scripts have this line:
#!bin/sh
Actually, there are many distribution where bin/sh is bash (maybe bin/sh is a link to bin/bash in those distributions), and not Bourne Shell.
I create symbolic link to the file - /etc/rc3.d/platform.bash from /var/tmp/platform.bash
ln -s /var/tmp/platform.bash /etc/rc3.d/platform.bash
script exist under /var/tmp :
-rwxr-xr-x 1 root root 58442 Aug 30 08:49 platform.bash
view from /etc/rc3.d :
lrwxrwxrwx 1 root root 31 Aug 30 06:33 S99platform.bash -> /var/tmp/platform.bash
After upgrading to a new release version, my bash scripts start spitting errors:
bash: /dev/stderr: Permission denied
in previous versions Bash would internally recognize those file names (which is why this question is not a duplicate of this one) and do the right thing (tm), however, this has stopped working now.
If you want to add a dash of GUI goodness to your Bash scripts, you have several options. You can use Zenity or Kdialog to quickly add simple dialogs and message boxes to Bash scripts. However, both tools are rather limited, and for a more complex GUI design you might want to give YAD a try.
I have 2 problems... 1. I am stupid and installed rvm as root... and 2. after realizing I did that I did rvm implode and now every folder I move too says:
Code:
-bash: /usr/local/rvm/scripts/initialize: No such file or directory
-bash: /usr/local/rvm/scripts/hook: No such file or directory
... where is this config written so I can remove it and start from scratch?