I have a problem that I cant figure out what to do in this function i need it to count multiple ranges like 0 10, 5 10, 1 100. I know that my counter needs to be outside the function and that it needs to be set to the lowest numbered positional parameter but thats were I am having trouble if anybody can take look at the code and help me out I would appreciate the help.
Isn't it what the seq command does ? (just as demonstrated above)
Try to enter these commands :
seq 0 10
seq 5 10
seq 1 100
Or could you please provide a full example of what input and output you expect (just as i did) so it may help us to understand your needs and provide a more accurante answer to you.
Thanks
Also when i run the script which i called lab5-4sh and when I want to run the script like this bash lab5-4.sh 1 10 i want it to have this output
$ ./lab5-4sh 1 10
1 2 3 4 5 6 7 8 9 10
10 9 8 7 6 5 4 3 2 1
that is what my goal is
can you help me with that I am a beginner to shell scripting so its hard for me to understand how to write the script
You may have to enforce the code to check that the $1 and $2 entries are numbers.
as well as find another way to handle the formatting not to depend on MAX_ARGS limitation due to the xargs usage , but it can still be a beginning.