5

I have $weMountedBoot set to false like this in the beginning of my script:

weMountedBoot=false

Now if it isn't mounted, and thus the conditional code runs I get this error and the variable is not set to true:

./verifyBootFiles: line 41: false=true: command not found

relevant code:

if ! mount | grep "/boot" > /dev/null

   then

      sudo mount -r -U $toCheck $mountPoint
      $weMountedBoot=true

   fi

What's wrong? As you probably figured I really like shell scripting and have loads of experience... so any other remarks about the code are also welcome.

2
  • Remember to upvote and choose the best answer. Regards. Commented Dec 25, 2011 at 22:13
  • unfortunately upvoting requires 15 rep... but I'll remember... Commented Dec 25, 2011 at 22:17

1 Answer 1

7

Just remove the leading $.

$weMountedBoot=true will be weMountedBoot=true.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.