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 8667291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:55:49+00:00 2026-06-12T17:55:49+00:00

if [ $DISTRO = REDHAT] || [ $DISTRO = FEDORA]; then if ! rpm

  • 0
if [ $DISTRO = "REDHAT"] || [ $DISTRO = "FEDORA"]; then 
    if ! rpm -qa | grep -q glibc-static; then
        $BIN_ECHO -e " Package [glibc-static] not found. Installing.. "
        yum install glibc-static
    elif
        $BIN_ECHO -e " All required packages installed.. "
    fi
elif [ $DISTRO = "DEBIAN"]; then 
    if ! dpkg-query -l glibc; then
        $BIN_ECHO -e " Package [glibc] not found. Installing.. "
        apt-get install glibc
    elif
        $BIN_ECHO -e " All required packages installed.. "
    fi
fi

line 156: syntax error near unexpected token `fi’

How do I put the two statements together?

  • 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-12T17:55:50+00:00Added an answer on June 12, 2026 at 5:55 pm

    You must have a space before the final ] on each test.

    For example:

    if [ $DISTRO = "REDHAT"] || [ $DISTRO = "FEDORA"]; then
    

    must be re-written as either:

     if [ "$DISTRO" = REDHAT ] || [ "$DISTRO" = FEDORA ]; then
    

    or

    if test "$DISTRO" = REDHAT || test "$DISTRO" = FEDORA; then
    

    Also note that there is no reason to quote literal strings, but you should quote variables.

    You can also do :

    if test "$DISTRO" = REDHAT -o "$DISTRO" = FEDORA; then
    

    or

    case "$DISTRO" in
    REDHAT|FEDORA) ... ;;
    DEBIAN) ... ;;
    esac
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just installed Sphinx (distro: archlinux) downloading the source. Then I installed Thinking Sphinx
I wish to make a self contained LAMP distro software package from source with
I'm using an RPM-based distro and I want to dynamically search a log file
Setup: Processor : x86_64 Operating System: GNU/Linux Distro: Fedora Release 13 (Goddard). Python 2.6.4
I'm using Arch Linux (Rolling Release Distro) and after the system upgrade I'm not
Let's say I'd like to start a small linux distro before my ordinary operating
Is there any resource or book for creating own linux distro.Only good resource i
I have a ARM based machine with ubuntu distro on it and it often
After going through the effort of finally purging distro ruby packages from my Ubuntu
I'm planning to take a non-GUI Linux distro (no Gnome, KDE, etc) and build

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.