I am creating a command that does the following;
commandname increment file num
file contains an integer
num is an integer
I want my command to add the value of arg2 to the content arg1
I was thinking;
#!/bin/sh
for $3 in ![0-9] # I am not even sure this would work
do
echo 1>&2 Error: You must enter an integer value
exit 5
done
# This is where I am completely lost. I am not sure how to write the value of "num" + `cat file` in "file"
Any help would be greatly appreciated.
Thanks
commandname increment file num
file contains an integer
num is an integer
I want my command to add the value of arg2 to the content arg1
I was thinking;
#!/bin/sh
for $3 in ![0-9] # I am not even sure this would work
do
echo 1>&2 Error: You must enter an integer value
exit 5
done
# This is where I am completely lost. I am not sure how to write the value of "num" + `cat file` in "file"
Any help would be greatly appreciated.
Thanks