Why are bash brace expansions not working for commands?
Why is this working:
mkdir /dir/test{1,2,3}
and this not?
{chown httpd,chmod 700} /dir/test1
-bash: {chown: command not found
My Bash Version is:
GNU bash, version 4.2.46(2)-release
bash brace-expansion
add a comment |
Why is this working:
mkdir /dir/test{1,2,3}
and this not?
{chown httpd,chmod 700} /dir/test1
-bash: {chown: command not found
My Bash Version is:
GNU bash, version 4.2.46(2)-release
bash brace-expansion
Perhapstee
+xargs
can help if you have a very long path which you don't want to repeat each time:tee >(xargs chown httpd) >(xargs chmod 700) <<< /dir/test1
.
– jimmij
Feb 11 at 12:53
1
You can also reference arguments in next command stackoverflow.com/a/3371299
– eckes
Feb 11 at 17:30
add a comment |
Why is this working:
mkdir /dir/test{1,2,3}
and this not?
{chown httpd,chmod 700} /dir/test1
-bash: {chown: command not found
My Bash Version is:
GNU bash, version 4.2.46(2)-release
bash brace-expansion
Why is this working:
mkdir /dir/test{1,2,3}
and this not?
{chown httpd,chmod 700} /dir/test1
-bash: {chown: command not found
My Bash Version is:
GNU bash, version 4.2.46(2)-release
bash brace-expansion
bash brace-expansion
edited Feb 11 at 12:05
Kusalananda
135k17255420
135k17255420
asked Feb 11 at 11:10
sysssyss
430617
430617
Perhapstee
+xargs
can help if you have a very long path which you don't want to repeat each time:tee >(xargs chown httpd) >(xargs chmod 700) <<< /dir/test1
.
– jimmij
Feb 11 at 12:53
1
You can also reference arguments in next command stackoverflow.com/a/3371299
– eckes
Feb 11 at 17:30
add a comment |
Perhapstee
+xargs
can help if you have a very long path which you don't want to repeat each time:tee >(xargs chown httpd) >(xargs chmod 700) <<< /dir/test1
.
– jimmij
Feb 11 at 12:53
1
You can also reference arguments in next command stackoverflow.com/a/3371299
– eckes
Feb 11 at 17:30
Perhaps
tee
+ xargs
can help if you have a very long path which you don't want to repeat each time: tee >(xargs chown httpd) >(xargs chmod 700) <<< /dir/test1
.– jimmij
Feb 11 at 12:53
Perhaps
tee
+ xargs
can help if you have a very long path which you don't want to repeat each time: tee >(xargs chown httpd) >(xargs chmod 700) <<< /dir/test1
.– jimmij
Feb 11 at 12:53
1
1
You can also reference arguments in next command stackoverflow.com/a/3371299
– eckes
Feb 11 at 17:30
You can also reference arguments in next command stackoverflow.com/a/3371299
– eckes
Feb 11 at 17:30
add a comment |
3 Answers
3
active
oldest
votes
Your brace expansion is not valid. A brace expansion must be one word in the shell.
A word is a string delimited by unquoted spaces (or tabs or newlines, by default), and the string {chown httpd,chmod 700}
consists of the three separate words {chmod
, http,chmod
and 700}
and would not be recognised as a brace expansion.
Instead, the shell would interpret the line as a {chown
command, executed with the arguments http,chmod
, 700}
and /dir/test1
.
The simplest way to test this is with echo
:
$ echo {chown httpd,chmod 700} /dir/test1
{chown httpd,chmod 700} /dir/test1
$ echo {"chown httpd","chmod 700"} /dir/test1
chown httpd chmod 700 /dir/test1
Note that even if your brace expansion had worked, the command would have been nonsensical.
Just write two commands,
chown http /dir/test1
chmod 700 /dir/test1
Is it possible to achieve the effect with quoting, or would that still not work?
– Time4Tea
Feb 11 at 11:20
1
Oh no, because you'd still have two commands on one line.
– Time4Tea
Feb 11 at 11:21
3
@Time4Tea One command, in fact, with the wrong arguments.
– Kusalananda
Feb 11 at 11:23
When you say "should", how would one be able to force multiple words? Or is it a "must"?
– syss
Feb 11 at 13:11
@syss It's "must" (I will change it in the text). A brace expansion expands to a set of words. If the brace expansion itself contains spaces, then these have to be quoted, as I have shown.
– Kusalananda
Feb 11 at 13:12
|
show 11 more comments
because, as mentioned in the man page, bash will perform the brace expansion on each word after splitting a command line into words.
So, that command line will be first split into {chown
, httpd,chmod
and 700}
, and then, since {chown
is not a valid brace expansion pattern, it will be left as is and bash will try to run a command with that name.
This is the quote from the manpage:
Expansion is performed on the command line after it has been split into
words. There are seven kinds of expansion performed: brace expansion,
tilde expansion, parameter and variable expansion, command substitution, arithmetic expansion, word splitting, and pathname expansion.
Notice the order, which is different from other shells (in zsh
, the brace expansion will be performed after the arithmetic expansion, and the extra word splitting won't be performed at all).
The following will print 1 2
in zsh
or ksh
, and x y
in bash
:
f=; f1=x; f2=y; echo $f{1,2}
when you say "Notice the order" on the expansions performed, brace expansion comes before word splitting. And in your first line you say that brace expansion comes after word splitting. I am confused by that
– syss
Feb 11 at 13:10
that's an extra word splitting which is done just before path expansion (globbing). if thea
variable contains the stringx y
, then a command line likeecho $a
will be 1st split intoecho
and$a
, then$a
will be expanded intox y
, and then split again intox
andy
, givingecho
,x
andy
as separate arguments. The latter step will be done using the value ofIFS
( not necessarily containing spaces) and does not happen inzsh
.
– mosvy
Feb 11 at 13:39
add a comment |
Other answers have explained why the brace expansion doesn't work. Ignoring that question for a moment, you probably want to avoid repeating the filename, and there are other ways to do that. Either assign the file name to a variable, or use the $_
special variable (it contains the last shell word of the previous command):
f="some long and ugly filename"
chown httpd "$f"
chmod 700 "$f"
or
chown httpd "some long and ugly filename"
chmod 700 "$_"
history expansion would also be an option, I just can't remember the correct expansion
– ilkkachu
Feb 11 at 14:17
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f499913%2fwhy-are-bash-brace-expansions-not-working-for-commands%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Your brace expansion is not valid. A brace expansion must be one word in the shell.
A word is a string delimited by unquoted spaces (or tabs or newlines, by default), and the string {chown httpd,chmod 700}
consists of the three separate words {chmod
, http,chmod
and 700}
and would not be recognised as a brace expansion.
Instead, the shell would interpret the line as a {chown
command, executed with the arguments http,chmod
, 700}
and /dir/test1
.
The simplest way to test this is with echo
:
$ echo {chown httpd,chmod 700} /dir/test1
{chown httpd,chmod 700} /dir/test1
$ echo {"chown httpd","chmod 700"} /dir/test1
chown httpd chmod 700 /dir/test1
Note that even if your brace expansion had worked, the command would have been nonsensical.
Just write two commands,
chown http /dir/test1
chmod 700 /dir/test1
Is it possible to achieve the effect with quoting, or would that still not work?
– Time4Tea
Feb 11 at 11:20
1
Oh no, because you'd still have two commands on one line.
– Time4Tea
Feb 11 at 11:21
3
@Time4Tea One command, in fact, with the wrong arguments.
– Kusalananda
Feb 11 at 11:23
When you say "should", how would one be able to force multiple words? Or is it a "must"?
– syss
Feb 11 at 13:11
@syss It's "must" (I will change it in the text). A brace expansion expands to a set of words. If the brace expansion itself contains spaces, then these have to be quoted, as I have shown.
– Kusalananda
Feb 11 at 13:12
|
show 11 more comments
Your brace expansion is not valid. A brace expansion must be one word in the shell.
A word is a string delimited by unquoted spaces (or tabs or newlines, by default), and the string {chown httpd,chmod 700}
consists of the three separate words {chmod
, http,chmod
and 700}
and would not be recognised as a brace expansion.
Instead, the shell would interpret the line as a {chown
command, executed with the arguments http,chmod
, 700}
and /dir/test1
.
The simplest way to test this is with echo
:
$ echo {chown httpd,chmod 700} /dir/test1
{chown httpd,chmod 700} /dir/test1
$ echo {"chown httpd","chmod 700"} /dir/test1
chown httpd chmod 700 /dir/test1
Note that even if your brace expansion had worked, the command would have been nonsensical.
Just write two commands,
chown http /dir/test1
chmod 700 /dir/test1
Is it possible to achieve the effect with quoting, or would that still not work?
– Time4Tea
Feb 11 at 11:20
1
Oh no, because you'd still have two commands on one line.
– Time4Tea
Feb 11 at 11:21
3
@Time4Tea One command, in fact, with the wrong arguments.
– Kusalananda
Feb 11 at 11:23
When you say "should", how would one be able to force multiple words? Or is it a "must"?
– syss
Feb 11 at 13:11
@syss It's "must" (I will change it in the text). A brace expansion expands to a set of words. If the brace expansion itself contains spaces, then these have to be quoted, as I have shown.
– Kusalananda
Feb 11 at 13:12
|
show 11 more comments
Your brace expansion is not valid. A brace expansion must be one word in the shell.
A word is a string delimited by unquoted spaces (or tabs or newlines, by default), and the string {chown httpd,chmod 700}
consists of the three separate words {chmod
, http,chmod
and 700}
and would not be recognised as a brace expansion.
Instead, the shell would interpret the line as a {chown
command, executed with the arguments http,chmod
, 700}
and /dir/test1
.
The simplest way to test this is with echo
:
$ echo {chown httpd,chmod 700} /dir/test1
{chown httpd,chmod 700} /dir/test1
$ echo {"chown httpd","chmod 700"} /dir/test1
chown httpd chmod 700 /dir/test1
Note that even if your brace expansion had worked, the command would have been nonsensical.
Just write two commands,
chown http /dir/test1
chmod 700 /dir/test1
Your brace expansion is not valid. A brace expansion must be one word in the shell.
A word is a string delimited by unquoted spaces (or tabs or newlines, by default), and the string {chown httpd,chmod 700}
consists of the three separate words {chmod
, http,chmod
and 700}
and would not be recognised as a brace expansion.
Instead, the shell would interpret the line as a {chown
command, executed with the arguments http,chmod
, 700}
and /dir/test1
.
The simplest way to test this is with echo
:
$ echo {chown httpd,chmod 700} /dir/test1
{chown httpd,chmod 700} /dir/test1
$ echo {"chown httpd","chmod 700"} /dir/test1
chown httpd chmod 700 /dir/test1
Note that even if your brace expansion had worked, the command would have been nonsensical.
Just write two commands,
chown http /dir/test1
chmod 700 /dir/test1
edited Feb 11 at 13:12
answered Feb 11 at 11:17
KusalanandaKusalananda
135k17255420
135k17255420
Is it possible to achieve the effect with quoting, or would that still not work?
– Time4Tea
Feb 11 at 11:20
1
Oh no, because you'd still have two commands on one line.
– Time4Tea
Feb 11 at 11:21
3
@Time4Tea One command, in fact, with the wrong arguments.
– Kusalananda
Feb 11 at 11:23
When you say "should", how would one be able to force multiple words? Or is it a "must"?
– syss
Feb 11 at 13:11
@syss It's "must" (I will change it in the text). A brace expansion expands to a set of words. If the brace expansion itself contains spaces, then these have to be quoted, as I have shown.
– Kusalananda
Feb 11 at 13:12
|
show 11 more comments
Is it possible to achieve the effect with quoting, or would that still not work?
– Time4Tea
Feb 11 at 11:20
1
Oh no, because you'd still have two commands on one line.
– Time4Tea
Feb 11 at 11:21
3
@Time4Tea One command, in fact, with the wrong arguments.
– Kusalananda
Feb 11 at 11:23
When you say "should", how would one be able to force multiple words? Or is it a "must"?
– syss
Feb 11 at 13:11
@syss It's "must" (I will change it in the text). A brace expansion expands to a set of words. If the brace expansion itself contains spaces, then these have to be quoted, as I have shown.
– Kusalananda
Feb 11 at 13:12
Is it possible to achieve the effect with quoting, or would that still not work?
– Time4Tea
Feb 11 at 11:20
Is it possible to achieve the effect with quoting, or would that still not work?
– Time4Tea
Feb 11 at 11:20
1
1
Oh no, because you'd still have two commands on one line.
– Time4Tea
Feb 11 at 11:21
Oh no, because you'd still have two commands on one line.
– Time4Tea
Feb 11 at 11:21
3
3
@Time4Tea One command, in fact, with the wrong arguments.
– Kusalananda
Feb 11 at 11:23
@Time4Tea One command, in fact, with the wrong arguments.
– Kusalananda
Feb 11 at 11:23
When you say "should", how would one be able to force multiple words? Or is it a "must"?
– syss
Feb 11 at 13:11
When you say "should", how would one be able to force multiple words? Or is it a "must"?
– syss
Feb 11 at 13:11
@syss It's "must" (I will change it in the text). A brace expansion expands to a set of words. If the brace expansion itself contains spaces, then these have to be quoted, as I have shown.
– Kusalananda
Feb 11 at 13:12
@syss It's "must" (I will change it in the text). A brace expansion expands to a set of words. If the brace expansion itself contains spaces, then these have to be quoted, as I have shown.
– Kusalananda
Feb 11 at 13:12
|
show 11 more comments
because, as mentioned in the man page, bash will perform the brace expansion on each word after splitting a command line into words.
So, that command line will be first split into {chown
, httpd,chmod
and 700}
, and then, since {chown
is not a valid brace expansion pattern, it will be left as is and bash will try to run a command with that name.
This is the quote from the manpage:
Expansion is performed on the command line after it has been split into
words. There are seven kinds of expansion performed: brace expansion,
tilde expansion, parameter and variable expansion, command substitution, arithmetic expansion, word splitting, and pathname expansion.
Notice the order, which is different from other shells (in zsh
, the brace expansion will be performed after the arithmetic expansion, and the extra word splitting won't be performed at all).
The following will print 1 2
in zsh
or ksh
, and x y
in bash
:
f=; f1=x; f2=y; echo $f{1,2}
when you say "Notice the order" on the expansions performed, brace expansion comes before word splitting. And in your first line you say that brace expansion comes after word splitting. I am confused by that
– syss
Feb 11 at 13:10
that's an extra word splitting which is done just before path expansion (globbing). if thea
variable contains the stringx y
, then a command line likeecho $a
will be 1st split intoecho
and$a
, then$a
will be expanded intox y
, and then split again intox
andy
, givingecho
,x
andy
as separate arguments. The latter step will be done using the value ofIFS
( not necessarily containing spaces) and does not happen inzsh
.
– mosvy
Feb 11 at 13:39
add a comment |
because, as mentioned in the man page, bash will perform the brace expansion on each word after splitting a command line into words.
So, that command line will be first split into {chown
, httpd,chmod
and 700}
, and then, since {chown
is not a valid brace expansion pattern, it will be left as is and bash will try to run a command with that name.
This is the quote from the manpage:
Expansion is performed on the command line after it has been split into
words. There are seven kinds of expansion performed: brace expansion,
tilde expansion, parameter and variable expansion, command substitution, arithmetic expansion, word splitting, and pathname expansion.
Notice the order, which is different from other shells (in zsh
, the brace expansion will be performed after the arithmetic expansion, and the extra word splitting won't be performed at all).
The following will print 1 2
in zsh
or ksh
, and x y
in bash
:
f=; f1=x; f2=y; echo $f{1,2}
when you say "Notice the order" on the expansions performed, brace expansion comes before word splitting. And in your first line you say that brace expansion comes after word splitting. I am confused by that
– syss
Feb 11 at 13:10
that's an extra word splitting which is done just before path expansion (globbing). if thea
variable contains the stringx y
, then a command line likeecho $a
will be 1st split intoecho
and$a
, then$a
will be expanded intox y
, and then split again intox
andy
, givingecho
,x
andy
as separate arguments. The latter step will be done using the value ofIFS
( not necessarily containing spaces) and does not happen inzsh
.
– mosvy
Feb 11 at 13:39
add a comment |
because, as mentioned in the man page, bash will perform the brace expansion on each word after splitting a command line into words.
So, that command line will be first split into {chown
, httpd,chmod
and 700}
, and then, since {chown
is not a valid brace expansion pattern, it will be left as is and bash will try to run a command with that name.
This is the quote from the manpage:
Expansion is performed on the command line after it has been split into
words. There are seven kinds of expansion performed: brace expansion,
tilde expansion, parameter and variable expansion, command substitution, arithmetic expansion, word splitting, and pathname expansion.
Notice the order, which is different from other shells (in zsh
, the brace expansion will be performed after the arithmetic expansion, and the extra word splitting won't be performed at all).
The following will print 1 2
in zsh
or ksh
, and x y
in bash
:
f=; f1=x; f2=y; echo $f{1,2}
because, as mentioned in the man page, bash will perform the brace expansion on each word after splitting a command line into words.
So, that command line will be first split into {chown
, httpd,chmod
and 700}
, and then, since {chown
is not a valid brace expansion pattern, it will be left as is and bash will try to run a command with that name.
This is the quote from the manpage:
Expansion is performed on the command line after it has been split into
words. There are seven kinds of expansion performed: brace expansion,
tilde expansion, parameter and variable expansion, command substitution, arithmetic expansion, word splitting, and pathname expansion.
Notice the order, which is different from other shells (in zsh
, the brace expansion will be performed after the arithmetic expansion, and the extra word splitting won't be performed at all).
The following will print 1 2
in zsh
or ksh
, and x y
in bash
:
f=; f1=x; f2=y; echo $f{1,2}
edited Feb 11 at 11:44
answered Feb 11 at 11:18
mosvymosvy
8,1621532
8,1621532
when you say "Notice the order" on the expansions performed, brace expansion comes before word splitting. And in your first line you say that brace expansion comes after word splitting. I am confused by that
– syss
Feb 11 at 13:10
that's an extra word splitting which is done just before path expansion (globbing). if thea
variable contains the stringx y
, then a command line likeecho $a
will be 1st split intoecho
and$a
, then$a
will be expanded intox y
, and then split again intox
andy
, givingecho
,x
andy
as separate arguments. The latter step will be done using the value ofIFS
( not necessarily containing spaces) and does not happen inzsh
.
– mosvy
Feb 11 at 13:39
add a comment |
when you say "Notice the order" on the expansions performed, brace expansion comes before word splitting. And in your first line you say that brace expansion comes after word splitting. I am confused by that
– syss
Feb 11 at 13:10
that's an extra word splitting which is done just before path expansion (globbing). if thea
variable contains the stringx y
, then a command line likeecho $a
will be 1st split intoecho
and$a
, then$a
will be expanded intox y
, and then split again intox
andy
, givingecho
,x
andy
as separate arguments. The latter step will be done using the value ofIFS
( not necessarily containing spaces) and does not happen inzsh
.
– mosvy
Feb 11 at 13:39
when you say "Notice the order" on the expansions performed, brace expansion comes before word splitting. And in your first line you say that brace expansion comes after word splitting. I am confused by that
– syss
Feb 11 at 13:10
when you say "Notice the order" on the expansions performed, brace expansion comes before word splitting. And in your first line you say that brace expansion comes after word splitting. I am confused by that
– syss
Feb 11 at 13:10
that's an extra word splitting which is done just before path expansion (globbing). if the
a
variable contains the string x y
, then a command line like echo $a
will be 1st split into echo
and $a
, then $a
will be expanded into x y
, and then split again into x
and y
, giving echo
, x
and y
as separate arguments. The latter step will be done using the value of IFS
( not necessarily containing spaces) and does not happen in zsh
.– mosvy
Feb 11 at 13:39
that's an extra word splitting which is done just before path expansion (globbing). if the
a
variable contains the string x y
, then a command line like echo $a
will be 1st split into echo
and $a
, then $a
will be expanded into x y
, and then split again into x
and y
, giving echo
, x
and y
as separate arguments. The latter step will be done using the value of IFS
( not necessarily containing spaces) and does not happen in zsh
.– mosvy
Feb 11 at 13:39
add a comment |
Other answers have explained why the brace expansion doesn't work. Ignoring that question for a moment, you probably want to avoid repeating the filename, and there are other ways to do that. Either assign the file name to a variable, or use the $_
special variable (it contains the last shell word of the previous command):
f="some long and ugly filename"
chown httpd "$f"
chmod 700 "$f"
or
chown httpd "some long and ugly filename"
chmod 700 "$_"
history expansion would also be an option, I just can't remember the correct expansion
– ilkkachu
Feb 11 at 14:17
add a comment |
Other answers have explained why the brace expansion doesn't work. Ignoring that question for a moment, you probably want to avoid repeating the filename, and there are other ways to do that. Either assign the file name to a variable, or use the $_
special variable (it contains the last shell word of the previous command):
f="some long and ugly filename"
chown httpd "$f"
chmod 700 "$f"
or
chown httpd "some long and ugly filename"
chmod 700 "$_"
history expansion would also be an option, I just can't remember the correct expansion
– ilkkachu
Feb 11 at 14:17
add a comment |
Other answers have explained why the brace expansion doesn't work. Ignoring that question for a moment, you probably want to avoid repeating the filename, and there are other ways to do that. Either assign the file name to a variable, or use the $_
special variable (it contains the last shell word of the previous command):
f="some long and ugly filename"
chown httpd "$f"
chmod 700 "$f"
or
chown httpd "some long and ugly filename"
chmod 700 "$_"
Other answers have explained why the brace expansion doesn't work. Ignoring that question for a moment, you probably want to avoid repeating the filename, and there are other ways to do that. Either assign the file name to a variable, or use the $_
special variable (it contains the last shell word of the previous command):
f="some long and ugly filename"
chown httpd "$f"
chmod 700 "$f"
or
chown httpd "some long and ugly filename"
chmod 700 "$_"
answered Feb 11 at 14:17
ilkkachuilkkachu
60.9k1098174
60.9k1098174
history expansion would also be an option, I just can't remember the correct expansion
– ilkkachu
Feb 11 at 14:17
add a comment |
history expansion would also be an option, I just can't remember the correct expansion
– ilkkachu
Feb 11 at 14:17
history expansion would also be an option, I just can't remember the correct expansion
– ilkkachu
Feb 11 at 14:17
history expansion would also be an option, I just can't remember the correct expansion
– ilkkachu
Feb 11 at 14:17
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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%2funix.stackexchange.com%2fquestions%2f499913%2fwhy-are-bash-brace-expansions-not-working-for-commands%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
Perhaps
tee
+xargs
can help if you have a very long path which you don't want to repeat each time:tee >(xargs chown httpd) >(xargs chmod 700) <<< /dir/test1
.– jimmij
Feb 11 at 12:53
1
You can also reference arguments in next command stackoverflow.com/a/3371299
– eckes
Feb 11 at 17:30