Bash

From Braindump
Revision as of 09:55, 10 March 2025 by Jan (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

https://www.gnu.org/software/bash/manual/bash.html

https://mywiki.wooledge.org/BashFAQ/

https://tldp.org/LDP/abs/html/string-manipulation.html

Echo from the 7th character in line, the next 3 characters

echo ${line:7:3}

Count the characters in the line

len=${#line}

Strip everything after the underscore

keyname=${key%%_*}

Strip everything before the slash

keyname=${keyname##*/}