|
|
|
|
|
by alganet
355 days ago
|
|
Yes, but also: https://wiki.ubuntu.com/DashAsBinSh#Why_was_this_change_made... > [bash] is rather large and slow to start up and operate by comparison with dash For more complex regular expressions, you can use `sed`. -- It's all a matter of context. Sometimes simple ## and %% param substitutions are the best tool for the job. I think bash is a fantastic interactive shell and a lousy script runner. |
|
One reason why I personally prefer to use Bashisms like ${x//str/replace} or [[ $value =~ $pattern ]] instead of doing the common x=$(echo $x | sed s/str/replace/) which has to launch two processes just for the sake of avoiding Bashism. (or grep -oP ... which is nice but a BASH_REMATCH is often simpler)