User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







bash:how_to:start

This is an old revision of the document!


bash: "How To"

operationwhatcodeexample export TST=“abcabcaa”result
removefirst occurence of characters 'xyz' in stringSTR=${STR/'xyz'}echo ${TST/'bc'}aabcaa
all characters 'xyz' in stringSTR=${STR'xyz'}|echo ${TST'bc'}aaaa
characters 'xyz' at end of stringSTR=${STR/%x}echo ${TST%'bcaa'}abca
first n charactersSTR=${STR:n}echo ${TST:2}
last n charactersSTR=${STR:-n}echo ${TST::-3}
extractall characters after position nSTR=${STR:n}echo ${TST:1}
m characters after position nSTR=${STR:n:m}echo ${TST:1:5}
characters after position n until end of string minus mSTR=${STR:n:-m}echo ${TST:1:-1}

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War
bash/how_to/start.1533241897.txt · Last modified: 2024/02/16 01:02 (external edit)

Impressum Datenschutz