Quantcast
Channel: how to express line feed in shell? - Unix & Linux Stack Exchange
Browsing latest articles
Browse All 4 View Live

Answer by Gilles for how to express line feed in shell?

Just include an actual newline inside the quotes (this works with either single or double quotes). Note that if the second line is indented, the spaces are part of the string. Furthermore always use...

View Article



Answer by orion for how to express line feed in shell?

One option is to use echo -e to expand the escape sequences. The second option is to simply use a "literal" newline (works in bash): str = "deb ... non-free "$'\n'"deb-src ... non-free " echo "$str"...

View Article

Answer by muru for how to express line feed in shell?

Aside from jasonwryan's suggestion, I'd suggest using printf: $ printf "%s http://ftp.cn.debian.org/debian/ wheezy main contrib non-free\n" deb deb-src > test $ cat test deb...

View Article

how to express line feed in shell?

Im my debian7.8 bash shell. str="deb http://ftp.cn.debian.org/debian/ wheezy main contrib non-free \n deb-src http://ftp.cn.debian.org/debian/ wheezy main contrib non-free " echo $str > test In my...

View Article
Browsing latest articles
Browse All 4 View Live




Latest Images