I am using MATLAB from my college network which has a limited number of users. So whenever I type matlab in terminal if the user limit is exceeded, then it shows errors: "user limit exceeded", and now I have to try again and again. I want to write a script that opens terminal and writes 'matlab' into it and if it opens then stop else keep on running.


while [ matlab | grep -q 'user limit exceeded' ]
   echo "Trying again"
echo "Success!"

That should do it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.