What is `$1- hour`? [duplicate]
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
-3
down vote
favorite
This question already has an answer here:
Variable with colon dash $VAR:-
1 answer
From https://stackoverflow.com/a/27595805/156458
date -d "next $1- hour" '+%H:00:00'
What is $1- hour
? Is it some shell parameter expansion, or input format of date and time?
Why does $1 hour
not work?
Thanks.
date coreutils
marked as duplicate by Ipor Sircer, ñÃÂsýù÷, Vlastimil, schily, Jesse_b Jul 29 at 14:20
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
-3
down vote
favorite
This question already has an answer here:
Variable with colon dash $VAR:-
1 answer
From https://stackoverflow.com/a/27595805/156458
date -d "next $1- hour" '+%H:00:00'
What is $1- hour
? Is it some shell parameter expansion, or input format of date and time?
Why does $1 hour
not work?
Thanks.
date coreutils
marked as duplicate by Ipor Sircer, ñÃÂsýù÷, Vlastimil, schily, Jesse_b Jul 29 at 14:20
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
-3
down vote
favorite
up vote
-3
down vote
favorite
This question already has an answer here:
Variable with colon dash $VAR:-
1 answer
From https://stackoverflow.com/a/27595805/156458
date -d "next $1- hour" '+%H:00:00'
What is $1- hour
? Is it some shell parameter expansion, or input format of date and time?
Why does $1 hour
not work?
Thanks.
date coreutils
This question already has an answer here:
Variable with colon dash $VAR:-
1 answer
From https://stackoverflow.com/a/27595805/156458
date -d "next $1- hour" '+%H:00:00'
What is $1- hour
? Is it some shell parameter expansion, or input format of date and time?
Why does $1 hour
not work?
Thanks.
This question already has an answer here:
Variable with colon dash $VAR:-
1 answer
date coreutils
asked Jul 29 at 13:28
Tim
22.5k61222398
22.5k61222398
marked as duplicate by Ipor Sircer, ñÃÂsýù÷, Vlastimil, schily, Jesse_b Jul 29 at 14:20
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 Ipor Sircer, ñÃÂsýù÷, Vlastimil, schily, Jesse_b Jul 29 at 14:20
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 |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
It's a parameter expansion, expanding to the text hour
if the first positional parameter is unset. Had the expansion been $1:- hour
, then it would have expanded to hour
also if the first positional parameter was empty (but set).
The code in the StackOverflow answer that you are linking to expects the first positional parameter to be something like day
or week
, but defaults to hour
using this expansion if the argument is not provided.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
It's a parameter expansion, expanding to the text hour
if the first positional parameter is unset. Had the expansion been $1:- hour
, then it would have expanded to hour
also if the first positional parameter was empty (but set).
The code in the StackOverflow answer that you are linking to expects the first positional parameter to be something like day
or week
, but defaults to hour
using this expansion if the argument is not provided.
add a comment |Â
up vote
2
down vote
accepted
It's a parameter expansion, expanding to the text hour
if the first positional parameter is unset. Had the expansion been $1:- hour
, then it would have expanded to hour
also if the first positional parameter was empty (but set).
The code in the StackOverflow answer that you are linking to expects the first positional parameter to be something like day
or week
, but defaults to hour
using this expansion if the argument is not provided.
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
It's a parameter expansion, expanding to the text hour
if the first positional parameter is unset. Had the expansion been $1:- hour
, then it would have expanded to hour
also if the first positional parameter was empty (but set).
The code in the StackOverflow answer that you are linking to expects the first positional parameter to be something like day
or week
, but defaults to hour
using this expansion if the argument is not provided.
It's a parameter expansion, expanding to the text hour
if the first positional parameter is unset. Had the expansion been $1:- hour
, then it would have expanded to hour
also if the first positional parameter was empty (but set).
The code in the StackOverflow answer that you are linking to expects the first positional parameter to be something like day
or week
, but defaults to hour
using this expansion if the argument is not provided.
edited Jul 29 at 13:56
answered Jul 29 at 13:43
Kusalananda
101k13199311
101k13199311
add a comment |Â
add a comment |Â