Find the answer to your Linux question:
Results 1 to 5 of 5

Thread: Confused

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1


    Hi all

    I am confused .

    When SUSE linux is loaded in an embedded
    bord , how usual controlcommands are writen
    like IF, WHILE, SWITCH .

    Does LINUX offer such commands ?

    If yes where online SUSE commands ore offered
    for refference ?


  2. #2
    those commands are typically built-in functions of a shell, such as Bash or C-Shell. for example, you could write a bash script using some of those functions like this:

    while [ $i -le $max ]; do
      echo $i
      if [ $i -eq $max ]; then
        echo This is the end
      i=$(( $i + 1 ))
      sleep 1
    copy that code to a file, e.g., named "", make it executable:

    chmod +x ./
    then execute it:

    To read more on the functions in Bash, read the man page:

    man bash
    The switch function is available in the C-shell (csh, tcsh, etc.), although you can emulate the functionality in bash. Read up on it in the tcsh man page:

    man tcsh

  3. #3
    In case of C language code is writen and cross compiled
    to deploy on the linux based board, how LINUX threads and tasks
    are includded in that C code ?

    do we include LINUX heder files at design time in the C code ?


  4. $spacer_open
  5. #4
    Okay, C programming. There is lots of documentation for that at your disposal. See this GNU article on using the getopt function, which also displays the switch function in action:

    Example of Getopt - The GNU C Library

    At the top of the example program there, you will see header include files at the top of the code, containing functions, etc. called within the program.

  6. #5

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts