dinsdag 13 maart 2012

BASH scripting

#!/bin/sh

when a child is forked or created from its parent, it receives a copy of the parents environment (incl env variabeles). child can change it's own env but those changes do noot reflect the parent

- wanneer je een shell script draait, een copy van de shell (subshell) wordt aangemaakt


command substitutie

shell voert een set of commands uit en substitueert de output in de paats van de commands. Gebruik hiervoor de volgende vorm :
`command` (let op backquote of backticks gebruiken geen single quote

vb: DATE=`date` of USERS=`who|wc -l`

Geen opmerkingen:

Een reactie posten