Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!njin!uupsi!rodan!rodan.acs.syr.edu!jdpeek From: jdpeek@rodan.acs.syr.edu (Jerry Peek) Newsgroups: comp.unix.questions Subject: csh quoting question: nested command substitution Message-ID: <4031@rodan.acs.syr.edu> Date: 26 Jul 90 00:51:08 GMT Sender: jdpeek@rodan.acs.syr.edu Reply-To: jdpeek@rodan.acs.syr.edu (Jerry Peek) Organization: Syracuse University, Syracuse, NY Lines: 18 Okay, I can tell that I obviously don't understand csh quoting. I want to set the csh prompt, but this question is really more generic than prompt-setting. In the Bourne shell, I can do: PS1="`/bin/expr \`/bin/hostname\` : '\([^.]*\)'`$ " which runs basename, then strips off anything after the local host name. So, if /bin/hostname prints rodan.acs.syr.edu, the prompt is rodan$. And, if /bin/hostname prints rodan, the prompt is still rodan$. I know there are lots of other ways to do this (pipe to sed, store hostname output in a shell variable first, etc.). But I want to do it in csh, in a nice one-liner like sh lets me. No matter what I do, I get some kind of syntax error. Can someone at least tell me how... and, better, tell me *why*? Thanks. --Jerry Peek; Syracuse University Academic Computing Services; Syracuse, NY jdpeek@rodan.acs.syr.edu, JDPEEK@SUNRISE.BITNET +1 315 443-3995