3

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

svn-log http://svn-repo

when I add something as first argument

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

runs

svn-log  http://svn-repo/path-to-something
Shuman
  • 287
  • 2
  • 3
  • 10

1 Answers1

0

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

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

> blatt blah
blah
> 
thrig
  • 34,938