Published on

Linux Tools for Software Development

Table of Contents

https://learning.edx.org/course/course-v1:LinuxFoundationX+LFD108x+1T2022/home


Bash Scripting

Some environment variables are avaliable to be used

  • $0 -> Command name
  • $1, $2 ... -> Command arguments
  • $* -> Represents them all
  • $@ -> Represents them all, preserving the grouping of quoted arguments
  • $# -> Gives the number of arguments

Conditionals

if condition
then
statements
else
statements
fi

File Conditionals

man 1 test -> Shows file tests (e.g. if a file exists, readable, writeable, executable?)