Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

reverse string in shell script

#!/bin/bash
read -p "Enter string:" string
len=${#string}
for (( i=$len-1; i>=0; i-- ))
do
# "${string:$i:1}"extract single single character from string.
reverse="$reverse${string:$i:1}"
done
echo "$reverse"
Comment

PREVIOUS NEXT
Code Example
Shell :: install expo 
Shell :: git create branch with specific commit 
Shell :: awk if else 
Shell :: GREPCC token 
Shell :: delete file hdfs dfs 
Shell :: move from commit to stage 
Shell :: react natibe debugger 
Shell :: git stash with message 
Shell :: bash create folder in current directory 
Shell :: flutter web setup 
Shell :: git untrack 
Shell :: install yt-dlp windows 
Shell :: ubuntu install arial font 
Shell :: bash check if file is empty 
Shell :: remove permission denied file folder linux 
Shell :: install vpn client for ubuntu 20.04 gui 
Shell :: git push example 
Shell :: powershell get all file extensions in directory 
Shell :: How to install LAMP in Ubuntu 20.04? 
Shell :: disable ssh login only keys 
Shell :: reset bash_profile 
Shell :: split string in shell script 
Shell :: jupyter python downkload 
Shell :: ubuntu setting not showing 
Shell :: find command 
Shell :: npm install less-loader 
Shell :: install openai gym 
Shell :: get current branch name git 
Shell :: linux get full path 
Shell :: compress folder ubutnu 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =