0

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.

bahamat
  • 39,666
  • 4
  • 75
  • 104
Kevdog777
  • 3,224

2 Answers2

1

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.

  • 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 07: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 'SO- stop being evil' Jul 19 '12 at 07: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 07: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 'SO- stop being evil' Jul 19 '12 at 07: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 07:44
  • Sorry Gilles, I actually have added the $PATH to .bashrc - .profile has the following text: bash - echo $PATH – Kevdog777 Jul 19 '12 at 07:48
  • I have added this to my .bashrc file: GCCPATH=/opt/K/SKUNK99/Gcc/2.95.2pl1/usr/local PATH=$PATH:$GCCPATH/bin:$GCCPATH/lib/gcc-lib/i386-pc-sco3.2v5.0.5/2.95.2 So you say I should add export LD_LIBRARY_PATH=/opt/K/SKUNK99/Gcc/2.95.2pl1/usr/local/lib to the .profile file instead of this .bashrc? – Kevdog777 Jul 19 '12 at 07:53
  • @Kevdog777 First, set environment variables in .profile, not in .bashrc. See http://unix.stackexchange.com/questions/3052/alternative-to-bashrc/3085#3085 For your compilation issue, you need to pass -I options to the compiler; you can use make CFLAGS='-I /opt/K/SKUNK99/Gcc/2.95.2pl1/usr/local/include' (or whatever the directory containing the headers is), but this should be normally done by setting the right options when compiling gcc. If you still have trouble compiling programs, I suggest that you ask a new question, and be sure to restate all the facts. – Gilles 'SO- stop being evil' Jul 19 '12 at 15:27
  • I have started a new question now Unable to find headers in GCC. I have managed to find those headers, but there is one remaining that I am battling to find. – Kevdog777 Jul 23 '12 at 15:04
0

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.

Kevdog777
  • 3,224