tcsh alias substitutions

I found a program that use precmd alias so I moved to postcmd and making this chage I decided to enhance the command in the alias. Before the command was
Code:
alias precmd rehash
now it is
Code:
alias postcmd 'rehash ; printf "\033]2;\!# \007"'
it not always works, the most of the times tcsh print
Code:
printf: illegal format character Y
I have some aliases that make use of substitution and they works fine. Is there something different in substitution with precmd and postcmd respect to normal aliases?
 
Seems to work if the second semicolon is escaped.
Code:
alias postcmd 'rehash ; printf "\033]2\;\!# \007"'
 
yes, it works for more commands. I have a common .cshrc for all users, it's not big but some lines give 'Missing ].' and 'printf: No match.' at login (after the postcmd alias). And a file '\007' in the home.
I can live without it, but...
 
It's a double/single quote matter both in the alias and in the printf. This works for me for most commands
Code:
alias postcmd "rehash ; printf -- '\033]2\;%s\007' '\!#'"
this one more less
Code:
alias postcmd 'rehash ; printf -- "\033]2\;%s\007" "\!#"'
It depends on the double/single quotes in the command. The 1st form works almost always except if the command contains single quotes. Executing this command
Code:
ff /usr/local '*wmiirc*'
give 'printf: No match' and don't set title. Executing this other it works (with the 1st form)
Code:
ff /usr/local "*wmiirc*"
ok, I'll think it over, another day. At the moment the 1st form is good.
 
Back
Top