Linux.com

Home Learn Linux Linux Answers Systems Management Reading script lines in a script file
Answers
  • Accepted Answer

    Are you sure it's a curly brace '{', and not a square bracket '['? The square bracket is just an alternative (and quite common) syntax for invoking the command test (1). According to the man page, '-x' checks if a file is executable, '-a' means 'and', '-e' checks if a file exists.

    So in other words, if the command was actually something like

    if [ -x /usr/bin/find -a -e /lib/modules/$RELEASE/modules.dep ]

    then it would be equivalent to the pseudocode
    if ( ( /usr/bin/find is executable) and ( /lib/modules/$RELEASE/modules.dep exists ) )

    Answered by jabirali
    4 years ago
    0 1
  • Jabir is correct.

    To understand the flags using in the statements of a shell script you should read the bash manual, you can find an online version at http://linux.die.net/man/1/bash and search for the sequence that you are questioning.

    Answered by mfillpot
    4 years ago
    0 1
  • Thanks, that was helpful.

    Answered by saqman2060
    4 years ago
    0 0
  • try here http://linux.die.net

    there is more talk about linux script

    Answered by
    4 years ago
    0 0
Similar Questions Found
Questions from category Systems Management

Upcoming Linux Foundation Courses

  1. LFD320 Linux Kernel Internals and Debugging
    10 Nov » 14 Nov - Virtual
    Details
  2. LFS426 Linux Performance Tuning
    10 Nov » 13 Nov - Virtual
    Details
  3. LFD312 Developing Applications For Linux
    17 Nov » 21 Nov - Virtual
    Details

View All Upcoming Courses

Community Answers - Search


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board