From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <200611201459.kAKExL908680@zamenhof.cs.utwente.nl> To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] echo -n In-reply-to: Your message of "Mon, 20 Nov 2006 14:41:22 +0000." <200611201441.aa18804@salmon.maths.tcd.ie> References: <200611201441.aa18804@salmon.maths.tcd.ie> From: Axel Belinfante MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <8678.1164034761.1@zamenhof.cs.utwente.nl.cs.utwente.nl> Date: Mon, 20 Nov 2006 15:59:21 +0100 Topicbox-Message-UUID: e266dc0a-ead1-11e9-9d60-3106f5b1d025 > UNIX variants seem to vary (yes, I know, that's why they are called > variants) in their behaviour. On FreeBSD and NetBSD echo -n | wc > produces 0 0 0, agreeing with my intuition and the plan9 behaviour. > On Solaris, on the other hand, echo -n | wc produces 1 1 3. On my solaris (5.8) I see both behaviours, depending on the shell I use. The 1 1 3 is produced by /usr/bin/echo. its man page explains why we get this: If any operand is "-n", it will be treated as a string, not an option. The following character sequences will be recognized within any of the arguments: [...] \c print line without new-line [...] USAGE Portable applications should not use -n (as the first argu- ment) or escape sequences. ; /usr/bin/echo '\c' |wc 0 0 0 ; Axel.