From mboxrd@z Thu Jan 1 00:00:00 1970 From: will.senn@gmail.com (Will Senn) Date: Mon, 6 Nov 2017 22:49:35 -0600 Subject: [TUHS] Literal character escapes in v7 In-Reply-To: <201711070434.vA74YlrN020951@freefriends.org> References: <201711070434.vA74YlrN020951@freefriends.org> Message-ID: On 11/6/17 10:34 PM, arnold at skeeve.com wrote: > Will Senn wrote: > >> I'm not looking for code review, but the code is intended to replace the >> tabs and backspaces with \t and \b respectively, but I haven't been able >> to test it because I can't seem to make a backspace character appear in >> input. In later unices, ^V followed by the backspace would work, but >> that's not part of v7. Backspace itself is my erase character, so >> anytime I just type it, it backspaces :). > awk 'BEGIN { print "a\bc\td" ; exit }' | your-program > > Enjoy, > > Arnold > > P.S. The exit is needed for V7 awk, IIRC, not modern ones. This is a good idea, but... Here's my results from just running awk for \t, \n, and \b: $ awk 'BEGIN { print "a\tb" ; exit }'; a       b $ awk 'BEGIN { print "a\nb" ; exit }' anb $ awk 'BEGIN { print "a\bb" ; exit }' abb $ Strange. It looks like it's just ignoring the backslash in the case of \n and \b. Will -- GPG Fingerprint: 68F4 B3BD 1730 555A 4462 7D45 3EAA 5B6D A982 BAAF