daily pastebin goal
28%
SHARE
TWEET

Untitled

a guest Jan 13th, 2018 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. param1=value1
  2. param2=value2
  3. param3=value3
  4.    
  5. file="./parameters.txt"
  6.  
  7. if [ -f "$file" ]
  8. then
  9.     echo "$file found."
  10.  
  11.     while IFS='=' read -r key value
  12.     do
  13.         key=$(echo $key | tr '.' '_')
  14.         eval "${key}='${value}'"
  15.     done < "$file"
  16.  
  17. else
  18.     echo "$file not found."
  19. fi
  20.    
  21. if [ -z ${param1} ]
  22. then
  23.     echo "Param1 is empty"; exit 1
  24. fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top