How to use associative arrays safely inside arithmetic expressions?
A few Bourne-like shells support associative arrays: ksh93 (since 1993), zsh (since 1998), bash (since 2009), though with some differences in behaviour between the 3.
A few Bourne-like shells support associative arrays: ksh93 (since 1993), zsh (since 1998), bash (since 2009), though with some differences in behaviour between the 3.
On 2013-01-10 Glenn Fowler posted this to the ast-users mailing list:
How can I safely get the version of ksh from within a ksh script?
In my testing (in Bash and Z Shell), I saw no problems with defining functions or aliases or executable shell scripts which have hyphens in the name, but I’m not confident that this will be okay in all shells and in all use cases.
Consider Source code: 1. Parent.sh #!/usr/bin/ksh # No tee ksh Child.sh; exit_status=$?; echo "Exit status: ${exit_status}" # Using tee ksh Child.sh | tee -a log.txt; exit_status=$?; echo "Exit status: ${exit_status}" 2. Child.sh #!/usr/bin/ksh … exit 1; Output: Exit status: 1 Exit status: 0 Variable $exit_status is capturing the exit status of Child.sh and so is … Read more
I’m writing a set of shell functions that I want to have working in both Bash and KornShell93, but with Bash I’m running into a “circular name reference” warning.
I understand what brace expansion is, but I don’t know how best to use it.
I’m writing script is ksh. Need to find all directory names directly under the current directory which contain only files, not subdirectories.
I often write KSH shell scripts that follow the same pattern: