python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Bash param expansion "${var##pat}" behaves differently in script than in shell
I'm trying to use a pretty basic Bash parameter expansion in a script and it's not working; it works fine when I run it in my interactive shell, though. Here's the little test script:
<~> $ cat ...
Joe Casadonte
Votes: 0
Answers: 1
Meaning of "+x" in shell parameter expansion [ -z ${FILE+x}]
I am reading some bash code and I can't figure out what the "+x" modifier does in the if condition below.
I have read the doc about parameter expansion and about if [-z ..] but this +x perpl...
asachet
Votes: 0
Answers: 0
How does ANSI C-Quoting in Herestrings work?
Why is this not working?
bla="
multi
line
string
"
cat -A <<EOF
${bla//\$'\n'/\\\$'\n'}
EOF
this works:
cat -A <<EOF
$(cat <<<${bla//$'\n'/\\$'\n'})
EOF
as noted in ...
Booker B
Votes: 0
Answers: 2
Bash parameter expansion: get entire remainder of a string after an offset
How can I avoid rest=${burger:1:99999999999999}, is there something that can replace the 9999999999 while still getting the remainder of the string burger ?
BLSPR
Votes: 0
Answers: 1