Multiple commands in csh one liner if

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • paragpdoke
    New Member
    • Dec 2007
    • 62

    #1

    Multiple commands in csh one liner if

    Hello All.
    I hope I am asking this question in the right section of the site.

    I'm working on Solaris 10 and the shell is csh. My intent is to perform 2 tasks if a condition is not satisfied. I'm using the one liner syntax for if (one liner because I need to use this as an alias later). However, my observation is that this simply does not work:
    Code:
    if ( 0 != 1 ) (echo Message1; echo Message2;)
    All I see is:
    Code:
    (: Command not found
    Can anyone kindly help me identify my mistake and get it to echo those 2 messages?

    Thanks in advance,
    Parag Doke
  • Tin Dang
    New Member
    • Nov 2010
    • 1

    #2
    I tried: (in bash)

    if [ "0" != "1" ]; then (echo $mess1; echo $mess2); fi

    where mess1|2 are some variables.

    Comment

    • paragpdoke
      New Member
      • Dec 2007
      • 62

      #3
      Hello Tin.
      Thank you for your reply. However, I was looking for a csh solution (since I want to attempt this via an alias).

      Thanks in advance!
      Parag Doke

      Comment

      Working...