Tagged Questions
0
votes
2answers
101 views
Comparison of shells? [closed]
Do shells have any actual advantages or disadvantages? They can all run any binary, they all support pipes and > (output to file). Why would one choose bash over sh, or sh over ksh, etc? Why does ...
1
vote
1answer
368 views
Do shells support recursion?
I'm trying to write recursive functions in my shell scripts.
Consider the following code:
function printA {
if [[ "$1" = 0 ]]; then
return
else
echo "a$(printA $(("$1" - 1)))"
...
6
votes
1answer
166 views
Ksh features incorporated into Zsh?
I have been a user of Bash for some time. I want to learn at least one other shell now, so I have been picking up the Korn Shell. However, it doesn't look like Ksh has had major updates for almost ...
2
votes
1answer
109 views
When is using ~+ useful?
As I understand it, ~+ means the same thing as "the current working directory".
So echo ~+ should print the same as pwd.
What is the purpose of this tilde expansion ~+ ?
3
votes
2answers
367 views
ANDed conditional using regexp and variables
I want to test whether a line, read in from a file, has a specific beginning AND an ending containing a word held in a variable. Here's some code:
The input file is:
line one
#; line two
#; line ...
22
votes
5answers
1k views
When do you use brace expansion?
I understand what brace expansion is, but I don't know how best to use it.
When do you use it?
Please teach me some convenient and remarkable examples if you have your own tip.
64
votes
1answer
10k views
Difference between nohup, disown and &
What is the difference between
$ nohup foo
and
$ foo &
and
$ foo &
$ disown