News for hackers. Stuff that matters.
Re:In Praise Of –Dry-Run by Darfk on Saturday January 31, 2026 @10:05PM (#46843256)
Totally agree it shouldn't be for basic tools; but if I'm ever developing a script that performs any kind of logic before reaching out to a DB or vendor API and modifies 100k user records, creating a flag to just verify the sanity of the logic is a necessity.
Re:In Praise Of –Dry-Run by Joker_vD on Saturday January 31, 2026 @10:13PM (#46843299)

    if [ -n "$DRY_RUN" ] ; then
        alias rm='echo rm'
        alias cp='echo cp'
    fi
Of course, output redirects will still overwrite the files, since the shell does it and IIRC this behaviour can't be changed.
Re:In Praise Of –Dry-Run by digiown on Saturday January 31, 2026 @10:22PM (#46843328)
set -o noclobber
Re:In Praise Of –Dry-Run by james_marks on Saturday January 31, 2026 @10:11PM (#46843287)
Yep. First thing I do for this kind thing is make a preview=true flag so I don’t accidentally run destructive actions.
Re:In Praise Of –Dry-Run by mycall on Wednesday February 04, 2026 @07:09PM (#46893811)
Now I like that idea as an environment variable that takes precedence over the command parameters.