tag:blogger.com,1999:blog-3803541356848955053.post2251877322953009829..comments2013-12-13T02:05:53.553-08:00Comments on YJL: Printing separator line, aka. repeat character N times, in BashYu-Jie Linhttps://plus.google.com/115422682039760465813[email protected]Blogger2125tag:blogger.com,1999:blog-3803541356848955053.post-72277279211750805862013-04-05T01:23:01.344-07:002013-04-05T01:23:01.344-07:00This is nice tip for using /dev/zero.
Before I ed...This is nice tip for using /dev/zero.<br /><br />Before I edited your comment to fix the display, it was cut off at the redirection and I thought it was like:<br /><br />code>sep=$(head -c 72 <<< "-------------------------------------------------------------------------------------------------------")<br /><br />Your solution is great as one-liner and it has no problem with variable length.livibetterhttp://yjl.im/[email protected]tag:blogger.com,1999:blog-3803541356848955053.post-20001754820223687812013-04-04T14:58:52.897-07:002013-04-04T14:58:52.897-07:00My favorite (though I never would have come up wit...My favorite (though I never would have come up with this on my own):<br /><br />sep=$(head -c 72 </dev/zero | tr '\0' '=')<br /><br /><br /><br />One line. Simple. Easy.Brian[email protected]