Skip to content

Commit 3d6de75

Browse files
authored
Create CLI_check_ending_slash.sh
1 parent 753594d commit 3d6de75

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

CLI_check_ending_slash.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
# This snippet checks for ending slash in the argument ($1)
4+
5+
slash="/"
6+
if ! [[ "$1" =~ '/'$ ]]; then
7+
input=$1$slash
8+
else
9+
input=$1
10+
fi
11+
echo $input

0 commit comments

Comments
 (0)