0

I have to verify that a var exist, if it does, it has to put a phrase like : "hello how are you" into a variable.

i tried :

test -e cours_420216
if [ $? ]
echo "alrdy there"
else
echo "add this into" > cours_420216
user2180198
  • 5
  • 2
  • 3

1 Answers1

1

Variable assignment in bash is done in the form:

cours_420216="hello how are you"

echo "add this into" > cours_420216

would create a file and not assign a variable

bjhaid
  • 9,592
  • 2
  • 37
  • 47