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
grep -q "^$regex\$" "$file"
if [ $? -eq 1 ]; then
# regex pattern not found --> success
echo "SUCCESS"
echo "NOTFOUND"
else
# regex pattern found --> failure
echo "FAILURE"
echo "FOUND"
fi
else
# file does not exist --> line not in file
echo "SUCCESS"
echo "NOTFOUND"
fi

View File

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