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

  • SEARCH
  • Home
  • 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 8898679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:40:16+00:00 2026-06-15T00:40:16+00:00

This script is getting an error: elif [ $operation = "man" ]; then if

  • 0

This script is getting an error:

elif [ $operation = "man" ]; then
    if [ $aug1 = "add" ]; then         # <- Line 75
    echo "Man Page for: add"
    echo ""
    echo "Syntax: add [number 1] [number 2]"
    echo ""
    echo "Description:"
    echo "Add two different numbers together."
    echo ""
    echo "Info:"
    echo "Added in v1.0"
    echo ""
elif [ -z $aug1 ]; then
    echo "Please specify a command to read the man page."
else
    echo "There is no manual page for that command."
fi

I get this error:

calc_1.2: line 75: [: =: unary operator expected
  • 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-15T00:40:17+00:00Added an answer on June 15, 2026 at 12:40 am

    If you know you’re always going to use Bash, it’s much easier to always use the double bracket conditional compound command [[ ... ]], instead of the POSIX-compatible single bracket version [ ... ]. Inside a [[ ... ]] compound, word-splitting and pathname expansion are not applied to words, so you can rely on

    if [[ $aug1 == "and" ]];
    

    to compare the value of $aug1 with the string and.

    If you use [ ... ], you always need to remember to double quote variables like this:

    if [ "$aug1" = "and" ];
    

    If you don’t quote the variable expansion and the variable is undefined or empty, it vanishes from the scene of the crime, leaving only

    if [ = "and" ];
    

    which is not a valid syntax. (It would also fail with a different error message if $aug1 included white space or shell metacharacters.)

    The modern [[ operator has lots of other nice features, including regular expression matching.

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

Sidebar

Related Questions

This script is getting Microsoft JScript runtime error: Object expected on If (out_params.bGranted) line.
We're getting this error once a day on a script that runs every two
i'm getting dialogue box (Operation aborted) What is the problem in this code? <script
When I try to run this script I am getting an error at range
I keep getting this error: Error: uncaught exception: Syntax error, unrecognized expression: [object Object]
How do I fix this so my script will work. Getting this error: Warning:
I keep getting this error when I try and run this script. It has
I am getting server error for this script. I am assuming the SQL is
Getting this error when I try to run this script. I'm creating the function
I'm getting this error Traceback (most recent call last): File /home/<username>/flup/server/fcgi_base.py, line 558, in

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.