help-bash
[Top][All Lists]
Advanced

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

Re: \n displayed instead of newline


From: Greg Wooledge
Subject: Re: \n displayed instead of newline
Date: Wed, 30 Jun 2021 07:29:10 -0400

On Wed, Jun 30, 2021 at 07:58:34AM +0200, lisa-asket@perso.be wrote:
> This is what I have
> 
> 
> 
>     ua="grep -ir --exclude=\\*.el --include=\\*.{org,texi}  \\"
>     ub="  -C 8 \"hilbert\" /marshall/"
>     printf "Usage: %s\n %s\n" $ua $ub

This is a mess, starting with the fact that you didn't quote "$ua"
and "$ub".

I don't see what advantage you think you're gaining by splitting the
message into pieces like that.  If I were you, I'd throw this whole
thing away and use a here-document:

cat <<'EOF'
Usage: grep -ir --exclude=\*.el --include=\*.{orig,texi}  \
   -C 8 "hilbert" /marshall/
EOF

Just place the entire message directly into the script, exactly as you
want it to be printed.  (There's a tab-indented variant, if you want to
go down that road, but start with the simpler version first.)



reply via email to

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