Date: 2010-11-03 01:35 am (UTC)
karmag: Stylized face based on Dreamwidth logo (Default)
From: [personal profile] karmag
I just wanted to share the "pairs" trick, but yeah, there's certainly more you can do, and with the ${} construct more generally too. (did someone say "man sh"?)

On a side note, parameter expansion is apparently one of the areas where bash differs from plain sh, and not everything you can do will be portable. This kind of matching (both shortest and longest match) is, though.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

command_liners: A command line prompt with a blinking cursor after it, green against black. (Default)
Command Liners

January 2022

S M T W T F S
      1
2 345678
9101112131415
16171819202122
23242526272829
3031     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 1st, 2025 09:12 am
Powered by Dreamwidth Studios