title: csh script - Get substring or remove last character from string
body: <p>I'm trying to write a shell script. In that I'm getting path as location from user. I want to find out out if it ends with '/' or not. If it does, I have to remove it and assign it to another variable. </p>
  
  <p>Script I tried</p>
  
  <pre><code>#!/bin/csh
  
  set loc="/home/user/"
  if (("$loc" == */ ))
  then
      echo true
      set b=${loc::-1}
      echo $b
  else
      echo false
  endif
  </code></pre>
  
  <p>But I'm not getting any output.</p>