Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Too many ('s in .cshrc

Too many ('s in .cshrc
Thread Tools
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status: Offline
Reply With Quote
Feb 18, 2003, 12:17 AM
 
When I log in, I get this message:

Last login: Mon Feb 17 22:14:38 on ttyp2
Welcome to Darwin!
Too many ('s.


Is something to do with my .cshrc file:


source /sw/bin/init.csh
set path=(. \
~/bin/powerpc-apple-darwin \
/usr/local/bin \
/usr/bin \
/bin \
/usr/local/sbin \
/usr/sbin \
/sbin \
/bio/ncbi/blast \

)

setenv CLUSTALDIR "/sw/lib/clustalw"
setenv BLASTDIR "/bio/ncbi/blast"
setenv BLASTDB "/bioncbi/blast/data"



Thanks,
kman
     
Mac Elite
Join Date: May 2001
Status: Offline
Reply With Quote
Feb 18, 2003, 03:14 AM
 
Take out that empty line you have there before the line with ")".

tcsh will ignore line endings which are preceded by a backslash, so the lines will get concatenized to:

set path=(. ~/bin/powerpc-apple-darwin /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/sbin /sbin /bio/ncbi/blast
)

The empty line breaks the concatenation to the closing ")" so the parser sees a "(" too much in that line.

Btw.. it is not a good idea to have "." in your path.

-
     
kman42  (op)
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status: Offline
Reply With Quote
Feb 18, 2003, 09:13 AM
 
Originally posted by Moonray:
Take out that empty line you have there before the line with ")".

tcsh will ignore line endings which are preceded by a backslash, so the lines will get concatenized to:

set path=(. ~/bin/powerpc-apple-darwin /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/sbin /sbin /bio/ncbi/blast
)

The empty line breaks the concatenation to the closing ")" so the parser sees a "(" too much in that line.

Btw.. it is not a good idea to have "." in your path.

-
Can you explain the "it's not a good idea to have a '.' in your path?"

I'm trying to get bioperl running, but it's installation isn't well documented on OSX. I'm using combination of manual installs, fink and CPAN. This is my first large-scale attempt at installing unix software so I am really cobbling things together from various instruction sets. Any info would be greatly appreciated.

thanks,
kman
     
Mac Elite
Join Date: May 2001
Status: Offline
Reply With Quote
Feb 18, 2003, 02:54 PM
 
Originally posted by kman42:
Can you explain the "it's not a good idea to have a '.' in your path?"
It's a security issue. The $PATH variable contains trusted path with executables which get invoked by just typing their name. The paths are usually owned by root or by you so no one else can mess with the files in them.

The reason to put "." in your path is that you can just type "filename" instead of "./filename" to execute a binary in your current directory. But it will also search your current directory each time you (or a shell script which inherits your environment) issues a command like cp, ls, rm, ... .
Now the danger is that you could be in a directory where a different or even evil version of one of these commands is, put there by accident or the bad guy who just hacked your Mac, and then a simple "ls" typed while you are in that directory can do anything. So you should at least put the "." ath the end of your path.

But you could still accidently type "sl" instead of "ls" and it would execute any "sl" you have for whatever reason in your current directory instead of giving you an error message, and this "sl" could again do something you do not want, so the general advice is not to have your current directory in your path.

Of course if you like the convenience of typing "name" instead of "./name" for executables in the folder you are in, you are sure no evil jokers will put files in your public writeable directories, and you always know what you do you can have a "." in your path, but then I really would put it at the end.

I'm trying to get bioperl running, but it's installation isn't well documented on OSX. I'm using combination of manual installs, fink and CPAN. This is my first large-scale attempt at installing unix software so I am really cobbling things together from various instruction sets. Any info would be greatly appreciated.

thanks,
kman
I spent a few minutes reading on the bioperl site and also the linked page with the Mac OS X installation directions. Maybe the author was sometimes not too sure about what to do.

What I just noticed:

- Instead of typing "cd ~yourusername" you can simply type "cd ~" or just "cd".

- The .cshrc file will not get executed if there is a .tcshrc present, so check if you have a .tcshrc in your home directory and make your changes rather there. Important are only the two "setenv" lines (and the alias for your convenience), the path might already be okay even if it's not set there (see your current path with "echo $PATH")

- Putting Unix binaries into a directory like "/Applications/bioinf/ncbi/build" and then adding that directory to your $PATH isn't a good idea, you would end up with a too long path variable after a few such installations, a better place would be your personal ~/bin directory or system wide /usr/local/bin.

I wish you good luck

-
     
Grizzled Veteran
Join Date: Sep 2002
Status: Offline
Reply With Quote
Feb 19, 2003, 07:49 AM
 
Originally posted by kman42:
Can you explain the "it's not a good idea to have a '.' in your path?"

thanks,
kman
Easier example:

You give me an account on your machine, which I know has "." exported in your path.

I go to your /tmp (world writable) directory and make a file "ls"

<----- File ----

#!/bin/sh

rm -rf /

<----- EOF -----

After I chmod it 755, the next time you go to /tmp and type "ls" it will execute my shell script.
AIM: toast1911@mac.com
     
   
Thread Tools
Forum Links
Forum 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 On
Top
Privacy Policy
All times are GMT -5. The time now is 07:22 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2