I want to do this in one line because I want to use it in my aliases. Can I do this similarly in tcsh ? Using “${a:-b}” for variable assignment in scripts

There are some ways of doing it here but with if-else, can I do it in one line? http://www.grymoire.com/unix/CshTop10.txt

eg, how do I make first argument an special string if it is not given ?

setenv SVN_URL "http://svn-repo"
alias svn-log  'svn log \:!1'

I want it to be like this, if nothing added, then don't add anything (svn will use current path . )


svn-log http://svn-repo

when I add something as first argument

svn-log  http://svn-repo/path-to-something


svn-log  http://svn-repo/path-to-something

Probably not, but optional arguments are possible via history substitution in an alias definition.

> alias blatt 'echo \!:1*'
> blatt

> blatt blah

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.