output to file different than console. (ssh and zfs )

Brandon Allbery allbery.b at gmail.com
Thu Mar 10 21:13:12 UTC 2016


On Thu, Mar 10, 2016 at 4:08 PM, Johan Hendriks <joh.hendriks at gmail.com>
wrote:
>
> Op 10/03/16 om 19:43 schreef Brandon Allbery:
>
> On Thu, Mar 10, 2016 at 1:41 PM, Johan Hendriks < <joh.hendriks at gmail.com>
> joh.hendriks at gmail.com> wrote:
>
>> mytitle
>
>
> if ($?prompt) mytitle
>
> If I change mytitle to if ($?prompt) mytitle I get the following error.
> mytitle: command not found.
>
> This is how I have set it.
> alias mytitle 'printf "\033]0;$HOST\a"'
> if ($?prompt) mytitle
>

gah, csh! The one-line if form won't work with aliases. You need to use the
long form. :( This should work, then:

if ($?prompt) then
    mytitle
endif

(if not then I'll have to dig up whether aliases are any weirder in csh,
like in ksh/bash they don't take effect in the file in which they're
defined --- although that clearly is not the case here)

I actually do title setting as part of prompt setup, so it automatically
behaves nicely with non-interactive use, but that's a bit too much for csh
to handle (I use zsh).

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net


More information about the freebsd-stable mailing list