LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 04-26-2009, 11:47 PM   #1
threaderslash
Member
 
Registered: Dec 2008
Location: HongKong
Distribution: Fedora/Centos/RedHat
Posts: 115

Rep: Reputation: 15
Cool path auto start for gcc


I am trying to get gcc command to work out of the box in Solaris10. But the shell gives the message:

$ gcc prg1.cpp -o prg1.exe
bash: gcc: command not found

So, I have put in the file:

#.!/export/home/threader/local.profile
PATH=$PATH:/usr/local/bin:/usr/ccs/bin/:/usr/sfw/bin/; export PATH

then, 'reboot' to see how it goes. When then I tried again to run gcc, the same happens:

$ gcc prg1.cpp -o prg1.exe
bash: gcc: command not found

It only works if every time after restarting the computer I run on terminal:
$ PATH=$PATH:/usr/local/bin:/usr/ccs/bin/:/usr/sfw/bin/; export PATH

Any hints or suggestion on how to make it automatic?

Thanks Folks!
 
Old 04-27-2009, 12:18 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You can put those commands in your ~/.profile (you can create it if it doesn't exist) so it's available by you, or in /etc/profile to make it available for all users.
Better split it in 2 lines:
Code:
PATH=$PATH:/usr/local/bin:/usr/ccs/bin/:/usr/sfw/bin/
export PATH
 
Old 04-27-2009, 01:30 AM   #3
threaderslash
Member
 
Registered: Dec 2008
Location: HongKong
Distribution: Fedora/Centos/RedHat
Posts: 115

Original Poster
Rep: Reputation: 15
Cool

thanks a LOT! it worked.........
 
Old 04-27-2009, 01:31 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
If you want the setting to be done system wide, you can edit the /etc/default/login file and modify the "PATH=" line.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Add gcc to my path with vi bcaseytekah Linux - Newbie 6 01-12-2009 10:16 PM
gcc is not found in path hiimsa Linux - Desktop 4 11-17-2006 04:24 AM
How do I auto start modules that aren't auto loaded on boot? darkbluedrew Debian 2 09-18-2005 09:10 AM
eth0 Auto Connect, How to auto start on logon cornish Linux - Networking 2 05-09-2005 12:02 PM
Gcc not found in the $PATH redrobin77 Linux - Software 3 01-12-2004 11:08 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 03:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration