544 reputation
26
bio website
location Minneapolis, MN
age
visits member for 3 years, 4 months
seen Aug 7 at 19:55

Jun
20
answered using _< instead of < for stdin using bash
Jun
18
comment History of Bash globbing
@StéphaneChazelas That's all true, and I like how ksh is somewhat smart about it. It rarely comes in to play though unless actually constrained to POSIX. With almost every use for wordsplitting replaced by better features, and storing patterns in variables being an extreme nuisance anyway since you have to empty IFS, disable brace expansion everywhere but bash. I think it's still impossible to be completely safe with stored patterns. This old escape issue was never really resolved for instance.
Jun
18
comment History of Bash globbing
That bash follows existing practice so carefully while avoiding irreconcilably incompatible changes and extensions is one of its greatest strengths.
Jun
18
comment History of Bash globbing
Cool write-up! You actually can't use ~(opt:pat) for any of the capitalized options. Maybe print -r -- ~(Ei).*\.txt$. Putting the pattern inside seems to only be useful to avoid having to toggle an option on then off for part of a pattern. Oddly you can mix-and-match multiple pattern languages within the same glob though. ~(Ki)*.~(E)txt$ is equivalent. (In the end everything just gets converted to regex and passed to libast's regex engine internally).
Jun
18
comment History of Bash globbing
I see. So it actually was late enough to justify the need for an option. (I think the default being off is rather pointless these days but, interesting.)
Jun
18
comment History of Bash globbing
Has Bash ever not supported extglobs? As far as I'm aware Bash, zsh, and {pd,m}ksh have supported the exact same globs as documented in the ksh88 manual since early days. Ksh to this day doesn't even have an option to disable "extended" glob quantifiers, and ksh93 is the only one of the bunch to have any extensions beyond what ksh88 had.
May
2
comment How to get subshell's PID in Korn Shell (equivalent of $BASHPID)
@mirabilos I'm stubborn about my preference for ==. No sympathy for [ + == users, and austingroupbugs.net/view.php?id=375 is still in the works anyway. If people are still using pdksh then I blame you. Work harder! The bigger issue is zsh's missing implicit -n even in emulation modes. Depending on my mood I also use ! ${var+false}, [[ ! ${var+_} ]], or [[ -v var ]] (which you don't support either. Get cracking!)
Jul
31
answered Shell, Concatenating 2 strings to reference a 3rd variable
May
14
awarded  Yearling
Mar
23
revised Delete all but largest file of specific type
added 130 characters in body
Mar
20
comment Is it possible to use indirection for setting variables?
This isn't a good method, but your note about controlling variable names within a program is right on.
Mar
20
answered Delete all but largest file of specific type
Mar
19
comment What does ${1+“$@”} mean in a shell script, and how does it differ from “$@”?
Ah I see. <3 Mascheck pages.
Mar
19
comment What does ${1+“$@”} mean in a shell script, and how does it differ from “$@”?
Can't reproduce in Heirloom. Probably not applicable to Solaris.
Feb
23
comment Shell script Variable Structure
Thanks for showing the correct methods. First example should use ${#snapshot[@]}, ideally (( ! ${#snapshot[@]} )), though in this specific case testing the 0th element will give the illusion of working anyway.
Jan
28
revised How to stop the find command after first match?
added 31 characters in body
Jan
28
answered How to stop the find command after first match?
Jan
28
revised How to get subshell's PID in Korn Shell (equivalent of $BASHPID)
added 84 characters in body
Jan
28
answered How to get subshell's PID in Korn Shell (equivalent of $BASHPID)
Jan
23
answered $BASHPID And $$ differ in some cases