Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Bad : modifier in $ (/)

    I am shell scripting in C-shell and I get the message:

    Bad : modifier in $ (/)

    The only slashes (/) I have in the script is at the start of the script, i.e: #!/bin/csh

    How can I make it work??

  2. #2
    Hello and welcome!

    I have moved your post to the Programming/Scripting forum, where it will hopefully get better attention.

  3. #3
    Quote Originally Posted by Captain_Quark View Post
    Bad : modifier in $ (/)
    It is possible that you have a variable butting up against another character, maybe a colon? it is hard to say without seeing your code. but this will yield a similar error:
    setenv dir '/tmp'
    echo $dir:a
    when i run the above i get:
    Bad : modifier in $ ( ).
    but if i enclose the variable in curly braces, e.g.:
    echo ${dir}:a
    then all is well:
    if this does not help, can you post your whole script?

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts