Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Where can I find the .profile in my user's logon in SCO?

I am needing to edit it, so I can add a PATH to it, so that my PATH loads up in start up.

I have to add:

echo $PATH

... as I have already edited the PATH.

Any help on where to find this .profile file would be greatly appreciated.

share|improve this question
    
@Bahamat: Thanks for the edit. It makes more sense that way :) –  Kevdog777 Jul 18 '12 at 15:55
add comment

2 Answers

up vote 1 down vote accepted

Your .profile, like any “dot file” (configuration file whose name begins with a .), is located in your home directory. This is the default directory when you log in, you can use the cd command with no argument to return there, and you can use ~ as a shortcut to it, e.g. you can refer to your .profile as ~/.profile no matter what the current directory is.

If your .profile is absent, the system behaves as if it was empty (this is the case for most dot files). So if you want to add something, create the file if necessary. Use the text editor of your choice.

Adding echo $PATH to .profile is useless, and even a bad idea because it can break remote file copying tools such as rsync. I don't understand what you're trying to do. If you want to add a directory to your PATH, put this in your ~/.profile:

PATH=$PATH:/some/extra/directory

This adds the specified directory last in the search path. Or if you want to add the subdirectory bin from your home directory to the front of the search path:

PATH=~/bin:$PATH

Some antique shells require an additional line export PATH, but I think even on SCO it isn't necessary this millennium.

share|improve this answer
    
Thank you for that. I recently installed GCC on this SCO machine, and it still won't work, as it can't find the lib files. So I thought I'd add the file path to the $PATH. This is the PATH that I put in: /opt/K/SKUNK99/Gcc/2.95.2pl1/usr/local/lib/gcc-lib/i386-pc-sco3.2v5.0.5/2.95.2/‌​ –  Kevdog777 Jul 19 '12 at 7:20
    
@Kevdog777 This directory doesn't look like something that should be in any search path. Also, if something can't find a library, you may need to add a directory to the library search path LD_LIBRARY_PATH, and not to the executable search path PATH. If you need more help, copy-paste the error message. –  Gilles Jul 19 '12 at 7:26
    
Sorry for being dof, but where can I find LD_LIBRARY_PATH? I just tried cd ~/LD_LIBRARY_PATH, and it said: bash: cd: /u/test/LD_LIBRARY_PATH: No such file or directory –  Kevdog777 Jul 19 '12 at 7:34
    
@Kevdog777 That's an environment variable, like PATH. You might add a line like export LD_LIBRARY_PATH=/opt/K/SKUNK99/Gcc/2.95.2pl1/usr/local/lib to your .profile. Note that I can't be sure this would solve your problem without seeing the exact error message. –  Gilles Jul 19 '12 at 7:39
    
There is not necessarily an error message. Just when I am compiling a script, I get the following files are not found. In file included from test.c:76: strutil.c:2: string.h: No such file or directory strutil.c:3: stdio.h: No such file or directory In file included from test.c:77: pcutils.h:3: ctype.h: No such file or directory In file included from test.c:78: pcutils.c:2: string.h: No such file or directory pcutils.c:3: stdio.h: No such file or directory test.c:79: time.h: No such file or directory test.c:81: stdio.h: No such file or directory - I will try add the export path now. –  Kevdog777 Jul 19 '12 at 7:44
show 4 more comments

I had to create the .profile file using the user's login and then I had to add:

echo $PATH

And then I logged off and back on, and it saved it correctly.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.