Reputation
564
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
2 6
Newest
 Yearling
Impact
~37k people reached

  • 0 posts edited
  • 0 helpful flags
  • 41 votes cast
Dec
16
comment How to duplicate a file without copying its data with btrfs?
@mikeserv "reducing" would be a better word. You're talking about lazy copying. It's an optimization in the allocation of resources. In contrast with deduplication, which is an active attempt to recover "wasted" resources. The KSM facility of Linux would be a good example of deduplication. After scanning for and replacing redundant pages with references, it uses an efficient copy-on-write scheme. They're related but distinct concepts.
Dec
16
comment How to duplicate a file without copying its data with btrfs?
@mikeserv Er, I'm pretty sure deduplication has a different sense. Deduplication is taking already existing redundant copies of data and re-unifying it. COW is a means of minimizing duplication, it isn't deduplication.
Dec
16
comment How to duplicate a file without copying its data with btrfs?
Note that this isn't anything like a hardlink. When you cp --reflink=always, the result from the user perspective will be two completely independent files in every way. The fact that the underlying file system is abstracting that via copy-on-write is only an implementation detail. You don't get "a hardlink, but with independent metadata.". To my knowledge, btrfs doesn't do any automatic deduplication yet. I think that's a future plan but I'm not positive on that.
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.
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