I want to take integers as command line arguments into a shell script and doing basic string manipulations with these integers.
For example:
# POSIX Shell
user@host $ ./script 3 4 1 5
^
| * * *
| * * * *
| *
| * * * * *
------------
user@host $
And some pseudocode to demonstrate, how I would like to achieve this:
# Pseudocode
#!/bin/sh
for arg in $#; do
echo $((arg * '* '))
done
# Or something similar with a loop ;-)
If someone got an idea that could lead me into the right direction in a pure POSIX Shell like /bin/sh, that would be very nice!