-d foo-* within single and double square brackets [duplicate]
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
This question already has an answer here:
In a Bash if condition, how to check whether any files matching a simple wildcard expression exist?
3 answers
What is the difference between [[ $a == z* ]] and [ $a == z* ]?
3 answers
I just discovered that in bash,[[ -d foo-* ]]
returns false ($?
set to 1) even if a directory named foo-bar
exists while [ -d foo-* ]
returns true ($?
set to 0)
I have to admit that I was surprised as I expected both versions to return true.
What is the rational behind this differing outcome?
bash wildcards test
marked as duplicate by Kusalananda
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Feb 16 at 7:47
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |Â
up vote
0
down vote
favorite
This question already has an answer here:
In a Bash if condition, how to check whether any files matching a simple wildcard expression exist?
3 answers
What is the difference between [[ $a == z* ]] and [ $a == z* ]?
3 answers
I just discovered that in bash,[[ -d foo-* ]]
returns false ($?
set to 1) even if a directory named foo-bar
exists while [ -d foo-* ]
returns true ($?
set to 0)
I have to admit that I was surprised as I expected both versions to return true.
What is the rational behind this differing outcome?
bash wildcards test
marked as duplicate by Kusalananda
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Feb 16 at 7:47
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
See also thebash
manual about[[ ... ]]
where it says "Word splitting and pathname expansion are not performed on the words between the[[
and]]
".
â Kusalananda
Feb 16 at 7:56
I missed that. Thanks for the clarification.
â René Nyffenegger
Feb 16 at 9:51
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
This question already has an answer here:
In a Bash if condition, how to check whether any files matching a simple wildcard expression exist?
3 answers
What is the difference between [[ $a == z* ]] and [ $a == z* ]?
3 answers
I just discovered that in bash,[[ -d foo-* ]]
returns false ($?
set to 1) even if a directory named foo-bar
exists while [ -d foo-* ]
returns true ($?
set to 0)
I have to admit that I was surprised as I expected both versions to return true.
What is the rational behind this differing outcome?
bash wildcards test
This question already has an answer here:
In a Bash if condition, how to check whether any files matching a simple wildcard expression exist?
3 answers
What is the difference between [[ $a == z* ]] and [ $a == z* ]?
3 answers
I just discovered that in bash,[[ -d foo-* ]]
returns false ($?
set to 1) even if a directory named foo-bar
exists while [ -d foo-* ]
returns true ($?
set to 0)
I have to admit that I was surprised as I expected both versions to return true.
What is the rational behind this differing outcome?
This question already has an answer here:
In a Bash if condition, how to check whether any files matching a simple wildcard expression exist?
3 answers
What is the difference between [[ $a == z* ]] and [ $a == z* ]?
3 answers
bash wildcards test
asked Feb 16 at 7:33
René Nyffenegger
7751617
7751617
marked as duplicate by Kusalananda
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Feb 16 at 7:47
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Kusalananda
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Feb 16 at 7:47
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
See also thebash
manual about[[ ... ]]
where it says "Word splitting and pathname expansion are not performed on the words between the[[
and]]
".
â Kusalananda
Feb 16 at 7:56
I missed that. Thanks for the clarification.
â René Nyffenegger
Feb 16 at 9:51
add a comment |Â
1
See also thebash
manual about[[ ... ]]
where it says "Word splitting and pathname expansion are not performed on the words between the[[
and]]
".
â Kusalananda
Feb 16 at 7:56
I missed that. Thanks for the clarification.
â René Nyffenegger
Feb 16 at 9:51
1
1
See also the
bash
manual about [[ ... ]]
where it says "Word splitting and pathname expansion are not performed on the words between the [[
and ]]
".â Kusalananda
Feb 16 at 7:56
See also the
bash
manual about [[ ... ]]
where it says "Word splitting and pathname expansion are not performed on the words between the [[
and ]]
".â Kusalananda
Feb 16 at 7:56
I missed that. Thanks for the clarification.
â René Nyffenegger
Feb 16 at 9:51
I missed that. Thanks for the clarification.
â René Nyffenegger
Feb 16 at 9:51
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
1
See also the
bash
manual about[[ ... ]]
where it says "Word splitting and pathname expansion are not performed on the words between the[[
and]]
".â Kusalananda
Feb 16 at 7:56
I missed that. Thanks for the clarification.
â René Nyffenegger
Feb 16 at 9:51