help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] Is there a construct in bash that can replace cat?


From: Eduardo A . Bustamante López
Subject: Re: [Help-bash] Is there a construct in bash that can replace cat?
Date: Mon, 19 Jan 2015 19:43:08 -0600
User-agent: Mutt/1.5.23 (2014-03-12)

> while read -r; do echo "$REPLY"; done
Actually, a better approximation would be:

while read -r; do printf %s\\n "$REPLY"; done
[[ "$REPLY" ]] && printf %s "$REPLY"

(test with 'a\nb\nc\nd' and 'a\nb\n-n\nd')



reply via email to

[Prev in Thread] Current Thread [Next in Thread]