- LinuxShell no LinuxShell ScriptEstruturas de Controle em Shell Script
- LinuxShell no LinuxShell ScriptVariáveis em Shell Script
Observe o Shell Script a seguir:
#!/bin/bash
ARQ=/tmp/dados.txt
echo "1" > $ARQ
if [ -b $ARQ ]; then X=1; fi
if [ -e $ARQ ]; then Y=2; fi
if [ -s $ARQ ]; then Z=3; fi
echo $X $Y $Z
A saída (output) do comando echo será: