How to avoid breaking a string parameter into multiple parameter?
I want to pass a string parameter to a Bash procedure. This procedure prints the string on console and prints a copy to a file.
In my use case, this file will contain a list of all executed commands in a Bash script that can be used to rerun all instructions in the same order. This is needed if an error occurs and I need to send a reproducer script to an open sourc project on GitHub. It will also copy all used files into a directory for later ZIP file creation.
So, let's talk Bash code:
#! /bin/bash
open() {
local File=$1
exec 3<> "$File"
}
close() {
exec 3>&-
}
procedure1() {
echo "$1"
echo "echo "$1"" >&3
}
procedure2() {
echo "$1" "$2"
echo "echo "$1" "$2"" >&3
}
procedure3() {
echo "$@"
echo "echo "$@"" >&3
}
# ==============================================================================
OUTPUT_FILE="output.sh"
Program_A="foo"
Paramater_A=(
--spam
--egg=4
)
Program_B="bar"
Paramater_B=(
--ham
--spice=4
)
open $OUTPUT_FILE
echo "$Program_A -a ${Paramater_A[@]}"
echo "$Program_B -b ${Paramater_B[@]}"
echo
procedure1 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
procedure2 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
procedure3 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
close
echo
echo -e "e[33m========================================e[0m"
echo -e "e[33mReading output file from diske[0m"
echo -e "e[33m========================================e[0m"
echo
cat $OUTPUT_FILE
The console output is this:
$ ./test.sh
foo -a --spam --egg=4
bar -b --ham --spice=4
foo -a --spam
foo -a --spam --egg=4
foo -a --spam --egg=4 bar -b --ham --spice=4
========================================
Reading output file from disk
========================================
echo "foo -a --spam"
echo "foo -a --spam" "--egg=4"
echo "foo -a --spam --egg=4 bar -b --ham --spice=4"
So what I see is, that ".... ${Parameter_A[@]} ..."
is contained in a string, but breaks the string into multiple strings. That's Why $1
in the procedure contains the string including the first parameter value.
How to embed all parameters into a single string without breaking it up into multiple strings?
$@
works to print all texts, because it contains all parameters passed to the procedure. However, it's not a solutions to me, because I can not distinguish when the string from $2
starts or in other words, how many parts belong to $1
.
string bash variable-expansion
add a comment |
I want to pass a string parameter to a Bash procedure. This procedure prints the string on console and prints a copy to a file.
In my use case, this file will contain a list of all executed commands in a Bash script that can be used to rerun all instructions in the same order. This is needed if an error occurs and I need to send a reproducer script to an open sourc project on GitHub. It will also copy all used files into a directory for later ZIP file creation.
So, let's talk Bash code:
#! /bin/bash
open() {
local File=$1
exec 3<> "$File"
}
close() {
exec 3>&-
}
procedure1() {
echo "$1"
echo "echo "$1"" >&3
}
procedure2() {
echo "$1" "$2"
echo "echo "$1" "$2"" >&3
}
procedure3() {
echo "$@"
echo "echo "$@"" >&3
}
# ==============================================================================
OUTPUT_FILE="output.sh"
Program_A="foo"
Paramater_A=(
--spam
--egg=4
)
Program_B="bar"
Paramater_B=(
--ham
--spice=4
)
open $OUTPUT_FILE
echo "$Program_A -a ${Paramater_A[@]}"
echo "$Program_B -b ${Paramater_B[@]}"
echo
procedure1 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
procedure2 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
procedure3 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
close
echo
echo -e "e[33m========================================e[0m"
echo -e "e[33mReading output file from diske[0m"
echo -e "e[33m========================================e[0m"
echo
cat $OUTPUT_FILE
The console output is this:
$ ./test.sh
foo -a --spam --egg=4
bar -b --ham --spice=4
foo -a --spam
foo -a --spam --egg=4
foo -a --spam --egg=4 bar -b --ham --spice=4
========================================
Reading output file from disk
========================================
echo "foo -a --spam"
echo "foo -a --spam" "--egg=4"
echo "foo -a --spam --egg=4 bar -b --ham --spice=4"
So what I see is, that ".... ${Parameter_A[@]} ..."
is contained in a string, but breaks the string into multiple strings. That's Why $1
in the procedure contains the string including the first parameter value.
How to embed all parameters into a single string without breaking it up into multiple strings?
$@
works to print all texts, because it contains all parameters passed to the procedure. However, it's not a solutions to me, because I can not distinguish when the string from $2
starts or in other words, how many parts belong to $1
.
string bash variable-expansion
Add a shebang and then paste your script there: shellcheck.net Ignore the certificate that expired today.
– Cyrus
Nov 24 '18 at 18:56
Nice checker! I see now, I need to change@
to*
which does not expand to single strings if contained in double quotes.
– Paebbels
Nov 24 '18 at 19:14
You should read I'm trying to put a command in a variable, but the complex cases always fail
– glenn jackman
Nov 24 '18 at 23:36
add a comment |
I want to pass a string parameter to a Bash procedure. This procedure prints the string on console and prints a copy to a file.
In my use case, this file will contain a list of all executed commands in a Bash script that can be used to rerun all instructions in the same order. This is needed if an error occurs and I need to send a reproducer script to an open sourc project on GitHub. It will also copy all used files into a directory for later ZIP file creation.
So, let's talk Bash code:
#! /bin/bash
open() {
local File=$1
exec 3<> "$File"
}
close() {
exec 3>&-
}
procedure1() {
echo "$1"
echo "echo "$1"" >&3
}
procedure2() {
echo "$1" "$2"
echo "echo "$1" "$2"" >&3
}
procedure3() {
echo "$@"
echo "echo "$@"" >&3
}
# ==============================================================================
OUTPUT_FILE="output.sh"
Program_A="foo"
Paramater_A=(
--spam
--egg=4
)
Program_B="bar"
Paramater_B=(
--ham
--spice=4
)
open $OUTPUT_FILE
echo "$Program_A -a ${Paramater_A[@]}"
echo "$Program_B -b ${Paramater_B[@]}"
echo
procedure1 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
procedure2 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
procedure3 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
close
echo
echo -e "e[33m========================================e[0m"
echo -e "e[33mReading output file from diske[0m"
echo -e "e[33m========================================e[0m"
echo
cat $OUTPUT_FILE
The console output is this:
$ ./test.sh
foo -a --spam --egg=4
bar -b --ham --spice=4
foo -a --spam
foo -a --spam --egg=4
foo -a --spam --egg=4 bar -b --ham --spice=4
========================================
Reading output file from disk
========================================
echo "foo -a --spam"
echo "foo -a --spam" "--egg=4"
echo "foo -a --spam --egg=4 bar -b --ham --spice=4"
So what I see is, that ".... ${Parameter_A[@]} ..."
is contained in a string, but breaks the string into multiple strings. That's Why $1
in the procedure contains the string including the first parameter value.
How to embed all parameters into a single string without breaking it up into multiple strings?
$@
works to print all texts, because it contains all parameters passed to the procedure. However, it's not a solutions to me, because I can not distinguish when the string from $2
starts or in other words, how many parts belong to $1
.
string bash variable-expansion
I want to pass a string parameter to a Bash procedure. This procedure prints the string on console and prints a copy to a file.
In my use case, this file will contain a list of all executed commands in a Bash script that can be used to rerun all instructions in the same order. This is needed if an error occurs and I need to send a reproducer script to an open sourc project on GitHub. It will also copy all used files into a directory for later ZIP file creation.
So, let's talk Bash code:
#! /bin/bash
open() {
local File=$1
exec 3<> "$File"
}
close() {
exec 3>&-
}
procedure1() {
echo "$1"
echo "echo "$1"" >&3
}
procedure2() {
echo "$1" "$2"
echo "echo "$1" "$2"" >&3
}
procedure3() {
echo "$@"
echo "echo "$@"" >&3
}
# ==============================================================================
OUTPUT_FILE="output.sh"
Program_A="foo"
Paramater_A=(
--spam
--egg=4
)
Program_B="bar"
Paramater_B=(
--ham
--spice=4
)
open $OUTPUT_FILE
echo "$Program_A -a ${Paramater_A[@]}"
echo "$Program_B -b ${Paramater_B[@]}"
echo
procedure1 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
procedure2 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
procedure3 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
close
echo
echo -e "e[33m========================================e[0m"
echo -e "e[33mReading output file from diske[0m"
echo -e "e[33m========================================e[0m"
echo
cat $OUTPUT_FILE
The console output is this:
$ ./test.sh
foo -a --spam --egg=4
bar -b --ham --spice=4
foo -a --spam
foo -a --spam --egg=4
foo -a --spam --egg=4 bar -b --ham --spice=4
========================================
Reading output file from disk
========================================
echo "foo -a --spam"
echo "foo -a --spam" "--egg=4"
echo "foo -a --spam --egg=4 bar -b --ham --spice=4"
So what I see is, that ".... ${Parameter_A[@]} ..."
is contained in a string, but breaks the string into multiple strings. That's Why $1
in the procedure contains the string including the first parameter value.
How to embed all parameters into a single string without breaking it up into multiple strings?
$@
works to print all texts, because it contains all parameters passed to the procedure. However, it's not a solutions to me, because I can not distinguish when the string from $2
starts or in other words, how many parts belong to $1
.
string bash variable-expansion
string bash variable-expansion
edited Nov 24 '18 at 19:11
Paebbels
asked Nov 24 '18 at 18:51
PaebbelsPaebbels
7,56383578
7,56383578
Add a shebang and then paste your script there: shellcheck.net Ignore the certificate that expired today.
– Cyrus
Nov 24 '18 at 18:56
Nice checker! I see now, I need to change@
to*
which does not expand to single strings if contained in double quotes.
– Paebbels
Nov 24 '18 at 19:14
You should read I'm trying to put a command in a variable, but the complex cases always fail
– glenn jackman
Nov 24 '18 at 23:36
add a comment |
Add a shebang and then paste your script there: shellcheck.net Ignore the certificate that expired today.
– Cyrus
Nov 24 '18 at 18:56
Nice checker! I see now, I need to change@
to*
which does not expand to single strings if contained in double quotes.
– Paebbels
Nov 24 '18 at 19:14
You should read I'm trying to put a command in a variable, but the complex cases always fail
– glenn jackman
Nov 24 '18 at 23:36
Add a shebang and then paste your script there: shellcheck.net Ignore the certificate that expired today.
– Cyrus
Nov 24 '18 at 18:56
Add a shebang and then paste your script there: shellcheck.net Ignore the certificate that expired today.
– Cyrus
Nov 24 '18 at 18:56
Nice checker! I see now, I need to change
@
to *
which does not expand to single strings if contained in double quotes.– Paebbels
Nov 24 '18 at 19:14
Nice checker! I see now, I need to change
@
to *
which does not expand to single strings if contained in double quotes.– Paebbels
Nov 24 '18 at 19:14
You should read I'm trying to put a command in a variable, but the complex cases always fail
– glenn jackman
Nov 24 '18 at 23:36
You should read I'm trying to put a command in a variable, but the complex cases always fail
– glenn jackman
Nov 24 '18 at 23:36
add a comment |
1 Answer
1
active
oldest
votes
As proposed by Cyrus, I used shellcheck.net to check my Bash script.
Here is the output from the checker:
$ shellcheck myscript
Line 24:
echo "echo "$@"" >&3
^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 33:
--egg=4
^-- SC2191: The = here is literal. To assign by index, use ( [index]=value ) with no spaces. To keep as literal, quote it.
Line 39:
--spice=4
^-- SC2191: The = here is literal. To assign by index, use ( [index]=value ) with no spaces. To keep as literal, quote it.
Line 44:
echo "$Program_A -a ${Paramater_A[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 45:
echo "$Program_B -b ${Paramater_B[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 47:
procedure1 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
>> ^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 48:
procedure2 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
>> ^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 49:
procedure3 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
>> ^-- SC2145: Argument mixes string and array. Use * or separate argument.
It shows that the used @
needs to be changed to *
. @
contained in double quotes expands to each array element contained in double quotes, whereas *
expands into the string.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53461357%2fhow-to-avoid-breaking-a-string-parameter-into-multiple-parameter%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
As proposed by Cyrus, I used shellcheck.net to check my Bash script.
Here is the output from the checker:
$ shellcheck myscript
Line 24:
echo "echo "$@"" >&3
^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 33:
--egg=4
^-- SC2191: The = here is literal. To assign by index, use ( [index]=value ) with no spaces. To keep as literal, quote it.
Line 39:
--spice=4
^-- SC2191: The = here is literal. To assign by index, use ( [index]=value ) with no spaces. To keep as literal, quote it.
Line 44:
echo "$Program_A -a ${Paramater_A[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 45:
echo "$Program_B -b ${Paramater_B[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 47:
procedure1 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
>> ^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 48:
procedure2 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
>> ^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 49:
procedure3 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
>> ^-- SC2145: Argument mixes string and array. Use * or separate argument.
It shows that the used @
needs to be changed to *
. @
contained in double quotes expands to each array element contained in double quotes, whereas *
expands into the string.
add a comment |
As proposed by Cyrus, I used shellcheck.net to check my Bash script.
Here is the output from the checker:
$ shellcheck myscript
Line 24:
echo "echo "$@"" >&3
^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 33:
--egg=4
^-- SC2191: The = here is literal. To assign by index, use ( [index]=value ) with no spaces. To keep as literal, quote it.
Line 39:
--spice=4
^-- SC2191: The = here is literal. To assign by index, use ( [index]=value ) with no spaces. To keep as literal, quote it.
Line 44:
echo "$Program_A -a ${Paramater_A[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 45:
echo "$Program_B -b ${Paramater_B[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 47:
procedure1 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
>> ^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 48:
procedure2 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
>> ^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 49:
procedure3 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
>> ^-- SC2145: Argument mixes string and array. Use * or separate argument.
It shows that the used @
needs to be changed to *
. @
contained in double quotes expands to each array element contained in double quotes, whereas *
expands into the string.
add a comment |
As proposed by Cyrus, I used shellcheck.net to check my Bash script.
Here is the output from the checker:
$ shellcheck myscript
Line 24:
echo "echo "$@"" >&3
^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 33:
--egg=4
^-- SC2191: The = here is literal. To assign by index, use ( [index]=value ) with no spaces. To keep as literal, quote it.
Line 39:
--spice=4
^-- SC2191: The = here is literal. To assign by index, use ( [index]=value ) with no spaces. To keep as literal, quote it.
Line 44:
echo "$Program_A -a ${Paramater_A[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 45:
echo "$Program_B -b ${Paramater_B[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 47:
procedure1 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
>> ^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 48:
procedure2 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
>> ^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 49:
procedure3 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
>> ^-- SC2145: Argument mixes string and array. Use * or separate argument.
It shows that the used @
needs to be changed to *
. @
contained in double quotes expands to each array element contained in double quotes, whereas *
expands into the string.
As proposed by Cyrus, I used shellcheck.net to check my Bash script.
Here is the output from the checker:
$ shellcheck myscript
Line 24:
echo "echo "$@"" >&3
^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 33:
--egg=4
^-- SC2191: The = here is literal. To assign by index, use ( [index]=value ) with no spaces. To keep as literal, quote it.
Line 39:
--spice=4
^-- SC2191: The = here is literal. To assign by index, use ( [index]=value ) with no spaces. To keep as literal, quote it.
Line 44:
echo "$Program_A -a ${Paramater_A[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 45:
echo "$Program_B -b ${Paramater_B[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 47:
procedure1 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
>> ^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 48:
procedure2 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
>> ^-- SC2145: Argument mixes string and array. Use * or separate argument.
Line 49:
procedure3 "$Program_A -a ${Paramater_A[@]}" "$Program_B -b ${Paramater_B[@]}"
^-- SC2145: Argument mixes string and array. Use * or separate argument.
>> ^-- SC2145: Argument mixes string and array. Use * or separate argument.
It shows that the used @
needs to be changed to *
. @
contained in double quotes expands to each array element contained in double quotes, whereas *
expands into the string.
answered Nov 24 '18 at 19:18
PaebbelsPaebbels
7,56383578
7,56383578
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53461357%2fhow-to-avoid-breaking-a-string-parameter-into-multiple-parameter%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Add a shebang and then paste your script there: shellcheck.net Ignore the certificate that expired today.
– Cyrus
Nov 24 '18 at 18:56
Nice checker! I see now, I need to change
@
to*
which does not expand to single strings if contained in double quotes.– Paebbels
Nov 24 '18 at 19:14
You should read I'm trying to put a command in a variable, but the complex cases always fail
– glenn jackman
Nov 24 '18 at 23:36