tux101
January 17th, 2006, 12:44 AM
I need help making a calculating script for bash. Would someone please help me out?
What I am trying to do is enter an entry, the script will do a modifcation of the entry. Then use the sum to carry out another task.
Lets say I ran the script, and the script asked me for the entry with
echo -n "entry: "
read entry
And I put in there "tux101@fakemail.com"
The script then carries out a simple calculation of subtracting the "101@fakemail.com" And then converts the "tux" into $I.
Then the script can use the $I to carry out other commands. Lets say it uses $I for a confirmation that will echo "Hi, Tux! Is tux101@fakemail.com spelled correctly?"
Don't worry about the confirmation part. I just want to know how I can get the script to modify an entry and then use the sum of it as a $I.
What I am trying to do is enter an entry, the script will do a modifcation of the entry. Then use the sum to carry out another task.
Lets say I ran the script, and the script asked me for the entry with
echo -n "entry: "
read entry
And I put in there "tux101@fakemail.com"
The script then carries out a simple calculation of subtracting the "101@fakemail.com" And then converts the "tux" into $I.
Then the script can use the $I to carry out other commands. Lets say it uses $I for a confirmation that will echo "Hi, Tux! Is tux101@fakemail.com spelled correctly?"
Don't worry about the confirmation part. I just want to know how I can get the script to modify an entry and then use the sum of it as a $I.