Script doesn't run

Hi everyone,

I've written a script, I gave it permission by
> chmod u+x myscript

and then tried to run it with
> myscript

and it didn't work, so I've written
> ./myscript

again, it didn't work, so I've written
> set path = (. $path)
but it didn't work as well.

I have some experience with unix and cshell (the script I wrote is a cshell one), and those are the only solutions I know for tracking a script in a path.

If you have any idea, I would love to hear it.
Thanks so much and happy holidays,
Shira. :slight_smile:

When you say did not run, what message did you get? You say you've written a csh script, which I assume is not the same as your interactive shell? Did you set the shebang correctly on the first line of your script. e.g.:

#!/bin/csh

Did you verify that csh exists at that location?

Of course, I've written many scripts in this environment.

I'm using a different computer now, and I know that it doesn't mean anything, but if it helps, the previous computer had windows xp os and now I have vista. Again, it doesn't mean anything, but perhaps it's a vital information.

And yes, I've written in the beginning of the script
#!/usr/local/bin/tcsh -f

When I try to run it, it says:
myscript: Command not found

Thanks,
Shira.

Please show the output of

which tcsh

the output is:

/bin/tcsh

thanks,
Shira.

Then you should change the first line of your script to

#!/bin/tcsh -f

Hi Jim!

Now I see what you mean.
I changed the opening of my script to just
#!/bin/tcsh -f

and now it works.
I had it in mind, but I've never thought it was the reason.
I guess it was because I changed my computer.

Thanks so much,
Shira.