Return values replaced
This commit is contained in:
		
					parent
					
						
							
								5333b98299
							
						
					
				
			
			
				commit
				
					
						35df795342
					
				
			
		
					 2 changed files with 4 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue