help-bash
[Top][All Lists]
Advanced

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

[Help-bash] printf -v


From: Wu Shuangrong
Subject: [Help-bash] printf -v
Date: Sun, 8 May 2016 23:42:44 +0800

Hello,
I am trying to save a string with a trailing newline to a variable, following 
is what i did:
printf -v var1 “%s\n” xyz
now when i echo $var1 it seems the newline disappears, as echo adds a newline 
to the end of the output, so i expected a blank line appeared on the screen, 
but that’s not what happened. So what’s happening here?

Thanks,
Shuangrong





reply via email to

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