News for hackers. Stuff that matters.

bhpnpmg

Re:Escaping strings in Bash using !:q on Friday October 02, 2020 @07:10PM (#24667961)
## key step: out=$((set -o xtrace;: "$@") 2>&1) # xtrace option shows us quoting for our args

    ## Cleanup $out
    #  only 1 of the next 4 'left trims' is expected to change $out:
    out=${out#+++++ }
      # if $FUNCNAME is eval'd three times there are five "+" chars
    out=${out#++++ }
      # if $FUNCNAME is eval'd twice there are four "+" chars
    out=${out#+++ }
      # if $FUNCNAME is eval'd there are three "+" chars
    out=${out#++ }
      # xtrace prepends the '++ '; ': ' is from our code shown above.
      # We strip these 5 left most chars.

    # Would be nice to support any level of evals, (hence any no.
    # of '+' chars) [...]
Re:Escaping strings in Bash using !:q on Friday October 02, 2020 @07:05PM (#24667929)
I wrote bash function that leverages 'set -x' to get me the quoting in "$@" into a single bash env var say $job or in to a temp file. I use it from time to time -- pretty sure it's not perfect, but it works well enough to be useful. To use it it usually involves an 'eval'.
Re:Ask HN: What news sources do you trust? on Wednesday November 20, 2019 @01:13PM (#21586616)
# My Shortlist of News sources

## websites: ##

### <https://projectcensored.org/> ###

### <https://consortiumnews.com> ###

### <https://www.truthdig.com/> ###

### <https://whowhatwhy.org> ###

### <http://accuracy.org/> ###

### <https://therealnews.com/> ###

### <https://www.freelists.org/feed/wikispooks> ###

### <http://www.sourcewatch.org/> ###

### <https://celdf.org/> ###

### <https://independentpoliticalreport.com/> ###

### <http://vdlf.org/> ###

### <http://www.wisconsinlaborhistory.org/> ###

### <http://wisdomwisconsin.org/> ###

### <https://www.americanswhotellthetruth.org/> ###

## Authors/Experts

### [Peter Martin Phillips Intro](#suxiy_Peter_Martin_Phillips_Intro__O072ObioO072O)

### [Robert Parry Intro](#lxxmo_Robert_Parry_Intro)

### [Peter Dale Scott intro](#fnmbt_Peter_Dale_Scott_intro)

### [William K. Black Intro](#ggvqj_William_K._Black)

### [Ray McGovern Intro](#zbhej_Ray_McGovern)

### [Seymour M Hersh](#pbbyq_Seymour_M_Hersh)

### [William F Pepper intro](#pfkpb_William_F_Pepper_intro)

### [Joe Lauria Intro](#mdqgl_Joe_lauria_Intro)

### [Thomas Linsey Intro](#bztbi_Thomas_Linsey_Intro)

### [Stephen F Cohen Intro ](#kknsh_Stephen_F_Cohen_Intro)

### [John Kiriakou intro](#ekysw_John_Kiriakou_intro)

### [Lance deHaven-Smith intro](#ngnle_Lance_deHaven-Smith_intro)

### [Micky Huff intro ](#yjpnt_Micky_Huff)

### [Kathy Kelly intro](#owwrm_Kathy_Kelly_intro)

### [Eva Bartlett intro](#ivtdj_Eva_Bartlett_intro)

### [Michel Chossudovsky Intro](#ufcfy_Michel_Chossudovsky_Intro)

### [Vanessa Beely Intro](#nemlb_Vanessa_Beely)

### [MMT Economist L. Randall Wray intro](#qqvmd_L._Randall_Wray)

### [Michael Hudson Intro](#onyri_Michael_Hudson)

### [Steve Lendman Intro](#ienhv_Steve_Lendman_Intro)

### [William Binney Intro](#atzha_William_Binney)

### [Alison Weir intro](#hpcjo_Alison_Weir_intro)

### [Margaret Flowers intro ](#rjmwo_Margaret_Flowers_intro_)

### [Andrei Raevsky "the saker" intro](#fkrsw_Andrei_Raevsky_AdqtAthe_sakerAdqtA_intro)

### [Ellen Brown Intro](#scdrg_Ellen_Brown)

### [Dave Winer Intro](#jkcjh_Dave_Winer_Intro)

### [Dave Lindorff intro](#bscjj_Dave_Lindorff_intro)

### [Eric Zuesse Intro](#mgcng_Eric_Zuesse)

### [Abby Martin Intro](#vlnia_Abby_Martin_Intro)

### [Gareth Porter intro](#eqbnw_Gareth_Porter_intro)

### [Stephen Gowans intro](#cosim_Stephen_Gowans_intro)

### [David Talbot intro](#cmkyq_David_Talbot_intro)

### [Norman G Finkelstein intro](#vtdqx_Norman_Finkelstein_intro)

Re:Show HN: now.sh on Monday March 11, 2013 @11:08PM (#5359842)
How about a script: a wrapper to run any other script or process, that logs both STDOUT and STDERR in one file, but prepends a short string of your choice for lines that are from STDERR.