Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!olivea!tymix!tardis!jms From: jms@tardis.Tymnet.COM (Joe Smith) Newsgroups: comp.unix.shell Subject: Re: Getting csh to preserve trailing blanks from backquoted commands. Message-ID: <1251@tardis.Tymnet.COM> Date: 28 Sep 90 19:53:40 GMT References: <1243@romana.Tymnet.COM> Reply-To: jms@tardis.Tymnet.COM (Joe Smith) Organization: BT Tymnet, San Jose, CA Lines: 15 In article <1243@romana.Tymnet.COM> I ask: >How do you pad a csh variable to specific length using trailing blanks? Answer: Use double quotes when setting the variable, and when referencing it. Part of it was a blind spot in my thinking. I had convinced myself that set who="`expr substr '$USER ' 1 8`" would not work since the $USER was inside single quotes. That was wrong. Due to the surrounding double quotes, "'" is treated as an apostrophe; just another printing character at the time variable substitution takes place. -- Joe Smith (408)922-6220 | SMTP: jms@tardis.tymnet.com or jms@gemini.tymnet.com BT Tymnet Tech Services | UUCP: ...!{ames,pyramid}!oliveb!tymix!tardis!jms PO Box 49019, MS-C41 | BIX: smithjoe | 12 PDP-10s still running! "POPJ P," San Jose, CA 95161-9019 | humorous dislaimer: "My Amiga 3000 speaks for me."