chubin / cheat.sheets

cheat.sh cheat sheets repository
MIT License
589 stars 210 forks source link

bash strings #172

Open spaceone opened 2 years ago

spaceone commented 2 years ago

There should be way more examples for bash string usage:

${foo:2} ${foo%…} ${foo#…} ${foo##…}

etc.

terminalforlife commented 2 years ago

Ah, parameter expansion is great. All but the first feature isn't exclusive to BASH though, as they're also available in Bourne Shell.

chubin commented 2 years ago

This is a very very useful contribution. Maybe we should move it to bash/expansion or shell/expansion ?

terminalforlife commented 2 years ago

Could do, since that would allow it to cover parameter expansion, brace expansion, tilde expansion, etc.