Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8831773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:23:07+00:00 2026-06-14T08:23:07+00:00

Hi i am working on somoething , i need to create a if statement

  • 0

Hi i am working on somoething , i need to create a if statement which will take multiple variables in ‘&&’ and ‘||’ combination . for now i am trying to this this simple task but i am getting errors ‘Command not found’. i want to first && two counts than || it with a flag i set in my code. following is the code i am trying

if [[$pcount -eq 0 ] && [$ucount -eq 0]] ||  [test $flag -eq 1]
then 
do my stuff 
else 
exit 1
fi

thank you in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:23:08+00:00Added an answer on June 14, 2026 at 8:23 am

    You can’t nest [ ... ] because [ is a shell command, not a separate syntactic construct. In Bash, you can use the [[ ... ]] syntactic construct which does support nesting, and in portable sh you can use the ( ... ) parentheses for precedence:

    if ([ $pcount -eq 0 ] && [ $ucount -eq 0 ]) ||  [ $flag -eq 1 ]
    

    Additional remarks:

    • [test condition] doesn’t make sense, since the [ operator is already an alias for test. Write either [ condition ] or test condition.

    • Leave a space before [ and the test, otherwise sh won’t recognize the [ as a command name. [ is a command like any other and is not associated with special parsing rules.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a project which I need to create a custom voice
I have this stored procedure, which has been working for a little while CREATE
Possible Duplicate: Grouping WHERE clauses with Zend_Db_Table_Abstract I need to create something like this:
I'm working on an ajax google maps script and I need to create dynamic
I have been working in DrRacket, trying to create a prefix function (#lang racket).
I need to create my own resource which sends some information to Zend_View instance
I have a model - Category which HABTM Blog. I need to create a
Im working in a memory restricted environment and need to create strings dynamically, but
I'm currently working on a project in which I need something like the following:
I'm working with wordpress and need to create a trigger that updates a table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.