Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
6
Task/Reverse-a-string/UNIX-Shell/reverse-a-string-1.sh
Normal file
6
Task/Reverse-a-string/UNIX-Shell/reverse-a-string-1.sh
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
str=abcde
|
||||
|
||||
for((i=${#str}-1;i>=0;i--)); do rev="$rev${str:$i:1}"; done
|
||||
|
||||
echo $rev
|
||||
3
Task/Reverse-a-string/UNIX-Shell/reverse-a-string-2.sh
Normal file
3
Task/Reverse-a-string/UNIX-Shell/reverse-a-string-2.sh
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
str='i43go1342iu 23iu4o 23iu14i324y 2i13'
|
||||
rev <<< "$str"
|
||||
#rev is not built-in function, though is in /usr/bin/rev
|
||||
Loading…
Add table
Add a link
Reference in a new issue