Reputation: 145
#!/bin/bash
echo "Please enter a number that can divided by 5"
read input
ans= 'expr $input/5'
echo "$ans"
So i want this code to be something like this, a user will enter a number that can divided by 5 (5,10,15,20 etc etc) and then it will echo the answer, i am not sure whats wrong with my code it keeps saying "no such file or directory " for output not sure how to fix that.
Upvotes: 0
Views: 3477
Reputation: 4396
I think the spaces were your problem...
#!/bin/bash
echo "Please enter a number that can divided by 5"
read input
ans=`expr $input / 5`
echo "$ans"
Upvotes: 3