I want to write a condition where it should paas only if variable contains either “full” or value between...
Confirming the Identity of a (Friendly) Reviewer After the Reviews
Would dual wielding daggers be a viable choice for a covert bodyguard?
Are neural networks prone to catastrophic forgetting?
Why are all my yellow 2V/20mA LEDs burning out with 330k Ohm resistor?
What was the definition of "set" that resulted in Russell's Paradox
How to memorize multiple pieces?
Constructive proof of existence of free algebras for infinitary equational theories
How many hours would it take to watch all of Doctor Who?
What steps should I take to lawfully visit the United States as a tourist immediately after visiting on a B-1 visa?
Need help identifying planes, near Toronto
During copyediting, journal disagrees about spelling of paper's main topic
If your plane is out-of-control, why does military training instruct releasing the joystick to neutralize controls?
Managing and organizing the massively increased number of classes after switching to SOLID?
What explains 9 speed cassettes price differences?
Why did Harry Potter get a bedroom?
How would my creatures handle groups without a strong concept of numbers?
How do you glue a text to a point?
Why are Hobbits so fond of mushrooms?
How were Martello towers supposed to work?
Using Newton's shell theorem to accelerate a spaceship
Misspelling my name on my mathematical publications
Keep milk (or milk alternative) for a day without a fridge
Is Trump personally blocking people on Twitter?
Why does the U.S. tolerate foreign influence from Saudi Arabia and Israel on its domestic policies while not tolerating that from China or Russia?
I want to write a condition where it should paas only if variable contains either “full” or value between 1-64
command condition sometimes integer sometimes stringHow can I test if a variable is empty or contains only spaces?Pass arguments to a command run by another userLooping through a shell array given as parameterHow can I safely ensure a variable contains only a valid filename?Need to pass multiple values from a file as an argumentChange a word based upon the file contentHow do I add the bin subdirectory of the first directory in GOPATH to PATH?How to check if a a variable contains both alphabets and numbersbash condition to restrict input options received from getopts
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
if [[ ${grp_no} -le "0" || ${grp_no} -ge "65" || ${grp_no} != "full"]]
then
exitprocess 1 ##it prints grp_no should b either full or between 1-64
fi
If I write this it says missing ]
.
How can I write this condition to pass only if grp_no
contains full or between 1-64?
shell-script shell
New contributor
add a comment |
if [[ ${grp_no} -le "0" || ${grp_no} -ge "65" || ${grp_no} != "full"]]
then
exitprocess 1 ##it prints grp_no should b either full or between 1-64
fi
If I write this it says missing ]
.
How can I write this condition to pass only if grp_no
contains full or between 1-64?
shell-script shell
New contributor
add a comment |
if [[ ${grp_no} -le "0" || ${grp_no} -ge "65" || ${grp_no} != "full"]]
then
exitprocess 1 ##it prints grp_no should b either full or between 1-64
fi
If I write this it says missing ]
.
How can I write this condition to pass only if grp_no
contains full or between 1-64?
shell-script shell
New contributor
if [[ ${grp_no} -le "0" || ${grp_no} -ge "65" || ${grp_no} != "full"]]
then
exitprocess 1 ##it prints grp_no should b either full or between 1-64
fi
If I write this it says missing ]
.
How can I write this condition to pass only if grp_no
contains full or between 1-64?
shell-script shell
shell-script shell
New contributor
New contributor
edited 2 mins ago
Peschke
2,9811 gold badge10 silver badges27 bronze badges
2,9811 gold badge10 silver badges27 bronze badges
New contributor
asked 16 mins ago
dollydolly
1
1
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You’re missing a space at the end of your if statement condition...
... ${grp_no} != "full"]]
Should be
... ${grp_no} != "full" ]]
Notice the space in between ”
and ]]
.
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
});
}
});
dolly is a new contributor. Be nice, and check out our Code of Conduct.
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%2f529481%2fi-want-to-write-a-condition-where-it-should-paas-only-if-variable-contains-eithe%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
You’re missing a space at the end of your if statement condition...
... ${grp_no} != "full"]]
Should be
... ${grp_no} != "full" ]]
Notice the space in between ”
and ]]
.
add a comment |
You’re missing a space at the end of your if statement condition...
... ${grp_no} != "full"]]
Should be
... ${grp_no} != "full" ]]
Notice the space in between ”
and ]]
.
add a comment |
You’re missing a space at the end of your if statement condition...
... ${grp_no} != "full"]]
Should be
... ${grp_no} != "full" ]]
Notice the space in between ”
and ]]
.
You’re missing a space at the end of your if statement condition...
... ${grp_no} != "full"]]
Should be
... ${grp_no} != "full" ]]
Notice the space in between ”
and ]]
.
answered 6 mins ago
PeschkePeschke
2,9811 gold badge10 silver badges27 bronze badges
2,9811 gold badge10 silver badges27 bronze badges
add a comment |
add a comment |
dolly is a new contributor. Be nice, and check out our Code of Conduct.
dolly is a new contributor. Be nice, and check out our Code of Conduct.
dolly is a new contributor. Be nice, and check out our Code of Conduct.
dolly is a new contributor. Be nice, and check out our Code of Conduct.
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%2f529481%2fi-want-to-write-a-condition-where-it-should-paas-only-if-variable-contains-eithe%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