Find the answer to your Linux question:
Results 1 to 3 of 3
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2013
    Posts
    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
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,318
    Hello and welcome!

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

  3. #3
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,318
    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:
    Code:
    #!/bin/csh
    setenv dir '/tmp'
    echo $dir:a
    when i run the above i get:
    Code:
    Bad : modifier in $ ( ).
    but if i enclose the variable in curly braces, e.g.:
    Code:
    echo ${dir}:a
    then all is well:
    Code:
    /tmp:a
    if this does not help, can you post your whole script?

Posting Permissions

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