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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:39:03+00:00 2026-06-12T12:39:03+00:00

./csf_install.sh: line 30: syntax error near unexpected token `CHECK_distro’ ./csf_install.sh: line 30: `CHECK_distro()’ My

  • 0
./csf_install.sh: line 30: syntax error near unexpected token `CHECK_distro'
./csf_install.sh: line 30: `CHECK_distro()'

My code:

    if [ "$(whoami &2>/dev/null)" != "root" ] && [ "$(id -un &2>/dev/null)" != "root" ] ; then
        $BIN_ECHO " must be root to run this script "
        exit 1
    else
        $BIN_ECHO -e " permission check passed "
    fi
    CHECK_architecture()
    CHECK_distro()
...
CHECK_architecture()
{
    architecture=`uname -m`
    if [ "$architecture" != "x86_64" ] && [ "$architecture" != "ia64" ]; then
        architecture="x86"
    else
        architecture="x86_64"
    fi
}

CHECK_distro()
{
    DISTRO="";
    if [ `uname -r | egrep '(6.2-RELEASE|6.1-RELEASE|5.5-RELEASE|6.1-STABLE|5.4-RELEASE|6.0-RELEASE|5.3-RELEASE|4.10-RELEASE|4.11-RELEASE)'` ]; then
        DISTRO="FreeBSD";
        $BIN_ECHO " System is running FreeBSD"
    elif [ -f /etc/debian_version ];  then
           $BIN_ECHO " System is running Debian Linux"
           DISTRO=DEBIAN;
    elif [ -f /etc/SuSE-release ]; then
           $BIN_ECHO " System is running SuSE Linux"
           DISTRO=SUSE;
    elif [ -f /etc/fedora-release ]; then
           $BIN_ECHO " System is running Fedora Linux"
           DISTRO=FEDORA;
    elif [ -f /etc/redhat-release ]; then
           $BIN_ECHO " System is running Red Hat Linux"
           DISTRO=REDHAT;
    else
        $BIN_ECHO -e " no supported distribution found running "
    exit 1
fi
}

Is it that my check code is wrong? Or is it how I am doing my functions? Do the functions need to come first?

ALSO

Is there a better way to check and set distribution of operating systems?

  • 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-12T12:39:04+00:00Added an answer on June 12, 2026 at 12:39 pm

    To call functions, leave off the () (you call them like any other shell command):

    CHECK_architecture
    CHECK_distro
    

    You will probably also want to declare the functions before using them to avoid any trouble.

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

Sidebar

Related Questions

I am trying to call Matlab functions from C++ code. With Matlab it comes
I am having trouble with the following error message: Object reference not set to
I have a config file filled with settings. Like a bunch of settings. I
I'm trying to install EPIC using the Pulse Explorer for Eclipse (as I'm rather
I'm having a problem where no matter what I try all Passenger instances are
I am running CentOS 5 with csf firewall. I'm running a program that can't
I tried to figure this out for some days now, I tried to use
I'm trying to write a query that selects from four tables campaignSentParent csp campaignSentEmail
I have an XML document I'm trying to traverse, which is SDMX-compliant. Here's a
Totally confused about the data types required here. I have this Linq statement: var

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.