Plouj
public text v1 · immutable#!/bin/bash
# check for the -t (testing) argument
ECHO=echo
TESTING=false
EXECUTER="" # blank by default because we want the proceeding commands executed
if [ "$1" = "-t" ]; then
$ECHO "testing"
TESTING=true
# since we are testing, we don't want commands to be executed
# rather, we just want to print what would be executed
EXECUTER=$ECHO
fi
$EXECUTER touch /tmp/blkjaalkjsf
$EXECUTER $ECHO printing 1...2...3
$ECHO this command always gets executed as coded