Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
google site



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-26-2009
shira's Avatar
Registered User
 

Join Date: Jan 2009
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Sponsored Links
  #2  
Old 12-26-2009
root cause analyst
 

Join Date: Nov 2008
Location: Amsterdam
Posts: 1,771
Thanks: 5
Thanked 78 Times in 75 Posts
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.:

Code:
#!/bin/csh

Did you verify that csh exists at that location?

Last edited by Scrutinizer; 12-26-2009 at 05:27 PM..
  #3  
Old 12-26-2009
shira's Avatar
Registered User
 

Join Date: Jan 2009
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
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.
  #4  
Old 12-26-2009
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 6,729
Thanks: 0
Thanked 53 Times in 50 Posts
Please show the output of

Code:
which tcsh

  #5  
Old 12-26-2009
shira's Avatar
Registered User
 

Join Date: Jan 2009
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
the output is:

/bin/tcsh

thanks,
Shira.
  #6  
Old 12-26-2009
root cause analyst
 

Join Date: Nov 2008
Location: Amsterdam
Posts: 1,771
Thanks: 5
Thanked 78 Times in 75 Posts
Then you should change the first line of your script to

Code:
#!/bin/tcsh -f

  #7  
Old 12-26-2009
shira's Avatar
Registered User
 

Join Date: Jan 2009
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Perl script 'system' linking to local shell script not working phpfreak Shell Programming and Scripting 5 10-16-2009 04:56 AM
(Urgent):Creating flat file using sql script and sqlplus from UNIX Shell Script praka Shell Programming and Scripting 6 04-15-2009 06:09 AM
need inputs on how i can change my script to reduce amount of time the script takes madhul2002 Shell Programming and Scripting 1 04-01-2009 07:40 PM
create a shell script that calls another script and and an awk script magikminox Shell Programming and Scripting 0 06-26-2008 02:50 AM
Shell Script: want to insert values in database when update script runs ring Shell Programming and Scripting 1 10-25-2007 03:06 AM



All times are GMT -4. The time now is 07:59 AM.