Shell Scripting

Is Shell Scripting a Language?


ps aux | grep [NameOfSomeProgramRunning]

I do believe it is. At least... it works for me. Shell scripting has helped me out on numerous occations over the years. When you need that quick and dirty to do a task or when you need to repeate a small task over and over again. Shell scripting is a very useful tool to have in your tool box.

You don't need to be in the unix world for very long before you start writing commands like...

can't use an alias for that. Soooo, write a small script. Stick it in your library and use it when you need it.

CREATED 2017-02-07 22:10:42.0

00-27-2A

UPDATED 2017-02-07 22:11:08.0


CREATED 2017-02-07 22:27:17.0

00-27-2B

UPDATED 2017-02-07 22:27:17.0

Flow Control...


Flow control uses these reserved words:

  • if
  • exit
  • for
  • while
  • until
  • case
  • break
  • continue

CREATED 2012-11-12 22:31:42.0

00-17-8E

UPDATED 2017-02-09 16:47:39.0

Boolean Logic in Shell Scripts...


if [ $number = "1" ]; then   echo "Something" fi

The almighty IF. Or boolean logic. Boolean because the result of the equation has to be true or false. In the case of linux scripting the exit status of the expression has to be a 0 (normal) or a 1 (abnormal)

Test is the variable number="1" actually equals 1




CREATED 2012-11-12 22:26:53.0

00-17-8D

UPDATED 2017-02-09 16:47:41.0

Knowledge

L
I
N
K
S

DBID: db.wam

Page Server: Ruger

©2012 Leistware Data Systems

      Hello anonymous