Commit fd1cf9dd authored by Ramon Nou's avatar Ramon Nou
Browse files

Update bash_testing2.sh for debug

parent e730ca1e
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
#!/bin/bash
set -x

ROOT=${1}

echo Creating a file from a echo with content foo
echo "foo" > $ROOT/a.out
echo "Creating a file from with content foo" in ${ROOT}

echo "foo" > ${ROOT}/a.out

echo "Testing if file exists"

if [ -f $ROOT/a.out ]; then
if [ -f ${ROOT}/a.out ]; then
     echo "File exists"
     echo "Testing if the content is correct"
     if grep -Fxq "foo" $ROOT/a.out
     if grep -Fxq "foo" ${ROOT}/a.out
     then
            echo "String found"
     else