DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 18th August 2010
carpman carpman is offline
Shell Scout
 
Join Date: Jul 2008
Posts: 94
Default add to path

Hello, i need to add to system path to but so far have been unable to do this, have tried

Code:
set path = (/hsphere/shared/java/diablo-jdk1.6.0/bin/java)
bash: syntax error near unexpected token `('
any idea what i am missing?

many thanks
Reply With Quote
  #2   (View Single Post)  
Old 18th August 2010
s0xxx's Avatar
s0xxx s0xxx is offline
Package Pilot
 
Join Date: May 2008
Posts: 192
Default

You're missing exactly what bash is telling you; it didn't expect '(' there. Also, path should be written with capital letters:
Code:
# export PATH=$PATH:/your/stuff/here
__________________
The best way to learn UNIX is to play with it, and the harder you play, the more you learn.
If you play hard enough, you'll break something for sure, and having to fix a badly broken system is arguably the fastest way of all to learn. -Michael Lucas, AbsoluteBSD
Reply With Quote
  #3   (View Single Post)  
Old 18th August 2010
carpman carpman is offline
Shell Scout
 
Join Date: Jul 2008
Posts: 94
Default

many thanks
Reply With Quote
  #4   (View Single Post)  
Old 18th August 2010
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

bare parens in sh-style languages generally mean run it in a subshell, or an error.

old idiomatic way: $ tar cf - . | (cd /somewhere; tar xf -)

is roughly a shortcut for: $ tar cf - . | sh -c "cd /somewhere; tar xf -"

the only time you should be seeing ( or ) in setting a path variable, is if you want to do something like $ PATH="$(pwd)/bin:$PATH"; export PATH.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #5   (View Single Post)  
Old 19th August 2010
s0xxx's Avatar
s0xxx s0xxx is offline
Package Pilot
 
Join Date: May 2008
Posts: 192
Default

Quote:
Originally Posted by TerryP View Post
...
the only time you should be seeing ( or ) in setting a path variable, is if you want to do something like $ PATH="$(pwd)/bin:$PATH"; export PATH.
Or if you're running a csh-like type of shell:
Code:
# csh
# echo $PATH
/sbin:/usr/sbin:/bin:/usr/bin ...                               # shorten for brevity

# set PATH = $PATH /usr/local
set: Variable name must begin with a letter.
# set PATH = ($PATH /usr/local)
# echo $PATH
/sbin:/usr/sbin:/bin:/usr/bin ... /usr/local
#
One could also use "" in stead of a pair of ()'s.
__________________
The best way to learn UNIX is to play with it, and the harder you play, the more you learn.
If you play hard enough, you'll break something for sure, and having to fix a badly broken system is arguably the fastest way of all to learn. -Michael Lucas, AbsoluteBSD
Reply With Quote
Reply

Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to use full path to commands and xorg.config problem phreud FreeBSD General 4 17th November 2008 07:44 PM


All times are GMT. The time now is 04:57 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick