Return values replaced

This commit is contained in:
Daniel Roth 2011-03-08 20:21:10 +01:00
parent 5333b98299
commit 35df795342
2 changed files with 4 additions and 7 deletions

View file

@ -29,13 +29,10 @@ regex=$(cat "$__object/parameter/line")
if [ -f "$file" ]; then if [ -f "$file" ]; then
grep -q "^$regex\$" "$file" grep -q "^$regex\$" "$file"
if [ $? -eq 1 ]; then if [ $? -eq 1 ]; then
# regex pattern not found --> success echo "NOTFOUND"
echo "SUCCESS"
else else
# regex pattern found --> failure echo "FOUND"
echo "FAILURE"
fi fi
else else
# file does not exist --> line not in file echo "NOTFOUND"
echo "SUCCESS"
fi fi

View file

@ -27,7 +27,7 @@ fi
result=$(cat "$__object/explorer/findline") result=$(cat "$__object/explorer/findline")
if [ $result = "SUCCESS" ]; then if [ "$result" = "NOTFOUND" ]; then
line=$(cat "$__object/parameter/line") line=$(cat "$__object/parameter/line")
echo "echo $line >> $file" echo "echo $line >> $file"
fi fi