Go Back   The macosxhints Forums > OS X Help Requests > UNIX - Newcomers



Reply
 
Thread Tools Rate Thread Display Modes
Old 09-01-2002, 02:17 AM   #1
Tavis
Triple-A Player
 
Join Date: Jan 2002
Location: Long Beach, CA USA
Posts: 56
Question path syntax?

After not following instructions in 10.1 and losing most of my terminal prefs in switching to 10.2, i decided to follow instructions and set up the ~/Library/init/tcsh directory and put my aliases and path files in there. Now i can't figure out how to write the path file to get the shell to recognize it. I've tried set path= (blah blah blah), i tried set $path= (blah blah blah) and i tried just blah blah blah. nothing seems to work. I test this by quitting terminal and restarting it, since these files should be read by every new shell that is opened, but perhaps i need to log out and log back in to see the changes?
Tavis is offline   Reply With Quote
Old 09-01-2002, 05:24 AM   #2
darkpaw
All Star
 
Join Date: Apr 2002
Location: England
Posts: 513
Try this: set path = ($path path_to_directory)

i.e. set path = ($path ~/Applications/bin) would add the ~/Applications/bin directory to your path.

This appends the new path to your existing path variable.

Go here:

http://www.ee.surrey.ac.uk/Teaching/Unix/unix8.html

for a simple tutorial on how to set and unset environment and shell variables.
__________________
http://www.keeponfighting.net - Fighting for animal rights
http://www.darkpaw.co.uk
http://www.needstuff.co.uk - Recycle your unwanted clutter for FREE! (UK only)
darkpaw is offline   Reply With Quote
Old 09-01-2002, 09:39 PM   #3
Tavis
Triple-A Player
 
Join Date: Jan 2002
Location: Long Beach, CA USA
Posts: 56
Still no dice...

I know i'm using the right syntax now, but i still get the default path when i use the echo command. I have the path file in ~/Library/init/tcsh/path. Is that the right place. Do I need to put the path file somewhere else?
Tavis is offline   Reply With Quote
Old 09-01-2002, 11:31 PM   #4
hschickel
All Star
 
Join Date: Jan 2002
Location: NY, NY
Posts: 776
Please see this hint.

Pay particular attention to this section:

Quote:
It turns out that the files which used to live at:

/usr/share/init/tcsh

have been moved to:

/usr/share/tcsh/examples/

With this change in path, the startup scripts fail to read the ~/Library/init/tcsh files. The README file in the examples directory gives the simple solution:

This directory contains some useful tcsh files. In order to use this configuration:

% echo "source /usr/share/tcsh/examples/rc" > ~/.tcshrc
% echo "source /usr/share/tcsh/examples/login" > ~/.login
% echo "source /usr/share/tcsh/examples/logout" > ~/.logout

To do this system-wide, do the same instead to /etc/csh.cshrc, /etc/csh.login, and /etc/csh.logout.

Once I ran the three "source" commands, my previously defined prompt, shortcuts and paths were back to normal.

And this section:

Quote:
There is a typo in /usr/share/tcsh/examples/aliases. Change the line that says:

if ("$TERM_PROGRAM" == "Apple_Terminal") then

to:

if ("$?TERM_PROGRAM" == "Apple_Terminal") then

Hugh
__________________
First they laugh at you, then they fight you, then you win.
hschickel is offline   Reply With Quote
Old 09-02-2002, 11:55 AM   #5
cadriopo
Prospect
 
Join Date: Jan 2002
Location: Luebeck, DE
Posts: 2
Smile .tcshrc-files

Hi, don't worry about the tcsh-path in MacOSX 10.2!
Look at this site, download the files and place the .tcsrc-files in your home-directory or follow the install-instructions:
http://tcshrc.sourceforge.net/
Now you can have all your custom tcsh-configurations back.
cadriopo is offline   Reply With Quote
Old 09-04-2002, 12:36 AM   #6
Tavis
Triple-A Player
 
Join Date: Jan 2002
Location: Long Beach, CA USA
Posts: 56
well...

I've run all of the echo commands, I've fixed the typo in my alias file, and i double checked that there are no superfluous spaces in the path to ~/Library/init/tcsh/path. And i still only get the default path. Any other ideas?
Tavis is offline   Reply With Quote
Old 09-04-2002, 08:45 AM   #7
hschickel
All Star
 
Join Date: Jan 2002
Location: NY, NY
Posts: 776
Tavis,

I've noticed on several machines that I was not able to run the echo command directly. I had to use a text editor on the files in question. This is most likely because the files already existed. I'll walk you through one example - you can extrapolate the rest.

Code:
[hschickel1:~] hugh% more /etc/csh.cshrc
# System-wide .cshrc file for csh(1).

if ($?prompt) then
        set promptchars = "%#"
        if ($?tcsh) then
                set prompt = "[%m:%c3] %n%# "
        else
                set prompt = "[%m:%c3] `id -nu`%# "
        endif
endif
[hschickel1:~] hugh%
This is the original csh.cshrc file. We want to change it. So...

sudo mv /etc/csh.cshrc /etc/csh.cshrc.original - change the name of the file

sudo pico /etc/csh.cshrc - open the pico text editor and create the file /etc/csh.cshrc

Type or paste:
source /usr/share/tcsh/examples/rc

<control>-x - to exit
y - to accept
<enter> - to write the file

Code:
[hschickel1:~] hugh% more /etc/csh.cshrc
source /usr/share/tcsh/examples/rc
[hschickel1:~] hugh%
Do the same for each.

Hugh
__________________
First they laugh at you, then they fight you, then you win.
hschickel is offline   Reply With Quote
Reply


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

Forum Jump



All times are GMT -5. The time now is 06:12 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.