You can use the ${parameter%word} expansion that is detailed here. Here is a simple test script that demonstrates the behavior:
#!/bin/bash
# Call this as:
# ./test.sh one/ two/ three/
#
# Output:
# one two three
echo ${@%/}
You can use the ${parameter%word} expansion that is detailed here. Here is a simple test script that demonstrates the behavior:
#!/bin/bash
# Call this as:
# ./test.sh one/ two/ three/
#
# Output:
# one two three
echo ${@%/}