🌉 bridged from @LemoineFairclough@sh.itjust.works by Tidepool
LemoineFairclough
@lemoinefairclough.sh.itjust.works.ap.tdpl.io
asklemmy Why do prisons exist?
0 0I found https://daily.jstor.org/the-invention-of-incarceration/ by using https://duckduckgo.com/?t=ftsa&q=punishment+before+prison&ia=web My assumption before even reading that was: I expect it's because people wanted a punishment that wasn't a monetary fine, corporal punishment, enslavement, death, or "death but we'll pretend to not see you running away, and we might pardon you in 10 years, but if we see you before then we'll kill you" (exile). I knew those were the only punishments in ancient Rome (and people weren't held for long before facing a trial), and it seems that not much had changed until the idea of long term incarceration was conceived: https://romanempiretimes.com/crime-and-punishment-in-ancient-rome-justice-and-inequality/ https://factsanddetails.com/world/cat56/sub408/entry-6360.html
mildlyinfuriating Steam has the best UI
0 0greentext Anon goes on holiday
0 0linux zcat shouldn't error out if you try to zcat an uncompressed file, it should just output the damned file !
0 0You are correct. This probably produces something more similar to what you'd want the original command to do, but with better safely:
bash
find -- . -type f -regex '^\./[^/]*$' -exec sh -c -- 'for file in "${@}"; do zcat -- "${file}" || cat -- "${file}" || exit; done' sh '{}' '+'That assumes you want to interact with files with names like
.hidden.txt.gzthough. If you don't, and only intend to have a directory with regular files (as opposed to directories or symbolic links or other types of file), using this is much simpler and even safer, and avoids using files in a surprising order:bash
for i in *; do zcat -- "$i" || cat -- "$i" || exit; done
Of course, the real solution is to avoid using the Shell Command Language at all, and to carefully adapt any program to your particular problem as needed: https://sipb.mit.edu/doc/safe-shell/