Set $PATH for current session in Terminal

Hello,
I want to modify the environment variable $PATH for the current terminal session. To modify it in $HOME/.profile (etc) is no option.
So I created a shell script called envsetup.sh which contains
ATLAS_HOME=/Applications/Development/atl-plugin-sdk
PATH=$ATLAS_HOME/bin:$PATH
export ATLAS_HOME PATH
When I execute the script, $PATH will only modified while running the script but does not alter it for the current session. But then I copy and paste it into the terminal, $PATH gets modified for the current session. What's wrong with it? On my Linux box, it works ...

Linux box, it works ...
This CANNOT work on your Linux box.
When you run a shell script (Mac OS X, Linux, HP-UX, Solaris, Tru64 UNIX, AIX, etc...), the shell script is runs in a child process. Any environment variables set or changed in that child process get destroyed when that child process ends, which happens as soon as the script ends. The parent process (your shell) will never see those child process environment variables. This has been true since the earliest versions of UNIX that I am aware of, and that goes back to at least '79.
Alternative approaches. You could create a shell function in your .profile
envsetup()
export ATLAS_HOME="/Applications/Development/atl-plugin-sdk"
export PATH="$ATLAS_HOME/bin:$PATH"
The next time you login, your .profile will run and you will have a new command "envsetup". When you invoke the command envsetup it will run within the context of your current shell, so those environment variables will be set and visible.
You could also create an alias that sources your envsetup.sh
alias envsetup 'source /path/to/envsetup.sh'
This would give you an easy to call command that would source into the current shell the export commands, as well as provide you with a script that can be sourced into other scripts that happen to need those specific exports.
Message was edited by: BobHarris

Similar Messages

  • Usually there is a upgrade path for current users of the software at a reduced price. I dont see anything like that for Lightroom 6. Will I have to pay full price just to upgrade to the new LR6 standalone version???

    Usually there is a upgrade path for current users of the software at a reduced price. I dont see anything like that for Lightroom 6. Will I have to pay full price just to upgrade to the new LR6 standalone version???

    The standalone upgrade is 79 US Dollars.
    Go to Products, select Lightroom 6, click on Buy, select Upgrade instead of Full

  • Create a formula variable using replacement path for current date

    Hi All,
    I created a formula variable using replacement path for current date.
    But when i used this variable am getting an error message saying .
    " This Variable cannot be used in this query".
    Could you please let me know the reason?
    Thanks,
    Zehra

    Hi All,
    Thanks for all your help...
    I just found a solution via the below link
    in Bex Formula variabel, Current calander day(sap exit) missing.
    Here he is trying to use the existing formula variable.
    My doubt here is, Even i could not find this varaible in BEX formula variable, But could see this in BI Content path as mentioned in the above link.  DO i have to transport this varaible , or i simply can activate it in production?
    I just could find this in BI Content but not in MetaData Repository.
    Thanks,
    Zehra

  • Set path for emacs

    Hi
    The emacs located in /opt/sfw/bin
    But how to set path for that so i can use emacs or other software in any other directory.
    I put
    set path=(/opt/sfw/bin $ path)
    in my home dir /export/home/joanna/.cshrc
    but it did not work.
    Which file should i modify and the format i put in ~/.cshrc is correct or not?
    Thanks
    Joanna

    The PATH variable is PATH and not path (The case of the shrinking Alphabets...?)
    And I think in the csh, it should be setenv and not set.
    BTW, csh is not really a good shell to be working on - use ksh instead.
    man csh
    man ksh

  • How do I keep a page as my home page when dragging icon to left of URL to house image & confirming that I want it as home page works only for current session, so when Firefox next opened, I end up with some stupid search page which McAfee doesn't like?

    A couple of days ago, I connected to the Internet as usual & opened Firefox, only to be greeted by an almost blank screen with a Google-type search box in the middle & this message from McAfee:
    "Your default search settings have changed. This may pose a security risk. Would you like to restore them to McAfee Secure Search to provide a safer searching experience?"
    instead of my usual home page (BT Yahoo). I naturally clicked on the "Yes" option in the message, but rather than restoring my BT Yahoo home page, all that did was to insert the McAfee logo to the left of the search box in the top right-hand corner of the screen. The first time it happened, I had to search for the BT Yahoo page & then followed the standard procedure for setting it again as my home page. It worked only for that session: each time I shut down Firefox or restarted my computer after that, all I got was the blank "search page" & restoring the previous session was the only way to get back to BY Yahoo. How on earth do I make the home page setting permanent?
    As far as I'm aware, I have done nothing to alter my search settings. However, I am anything but computer-literate, so I may have done/pressed something without realising it, but trying to understand what is now happening is far beyond my limited IT skills.

    See McAfee support to find out how to disable that McAfee feature - that isn't part of the normal Firefox installation.

  • How to know (package , procedures or functions) name for current sessions

    Hi all
    I'm DBA and i want to find way to get object name whatever (package , procedures or functions) for current running statement in active session.
    To clarify when i open session browser from toad i can see active sessions and see current statement for every session but without the name of the object.
    Is there any way to know this point.
    thanks in advance

    select *
      from dba_objects
    where object_id in (select nvl(t.PLSQL_ENTRY_OBJECT_ID,-1)
                           from v$session t
                          where sid = 452)
    Ramin Hashimzade

  • Setting path for third party class files

    I am using some third party classfiles in my JSPs for JDBC. When I use these files, in normal Java Programs everything is working fine ( I am setting the path by using the CLASSPATH environment variable).
    I did not understandt how to set classpath for these files (com.informix.jdbc.*) for use in iplanet 6.0.
    I have tried to keep this "com" folder in /usr/java/j2sdk1.4.3_01/lib folder, but, it is not still working. I tried to change the start-jvm file, but, I am still having problems.
    Can someone help me !!!
    --Murthy.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi,
    I changed the jvm12.conf file, but, it did not work. I changed the JDK Runtime Classpath in the Global Settings tab of the Administration Server and restarted both the webserver and the administration server and it worked.
    Thanks for your response.
    --Murthy.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Set path for package InCopy

    I noticed that on a Mac, when an InCopy Package file is opened, it 'unpacks' in the /user/documents folder (On a PC in 'Documents user'?).
    Is this path 'hardcoded' or is there a way to set the path to a desired folder?

    Gee I was hoping *you* would know, Bob! ;-)
    There's no user interface for it, so I'm guessing it's hard wired.
    FWIW on Windows the default location for unpacked assignments is "InCopy Assignments" at the top level of the user's My Documents folder.
    More control over default file paths for saving/unpacking is a great feature request for CS4.
    AM

  • Setting path for "Content-disposition" filename

    I'm trying to figure out how to set the filename in the following:
    String path = "/usr/local/jakarta-tomcat-4.1.29/webapps/myapp/my_images.zip";
    response.setContentType("application/octet-stream");
    response.setHeader("Content-disposition","attachment; filename=" +path);The file that I'd like the user to download is called my_images.zip. It resides here: /usr/local/jakarta-tomcat-4.1.29/webapps/myapp/my_images.zip
    However, when I run the servlet, it pops up a dialog box with this as the filename: usrlocal_jakarta-tomcat-4.1.29_webapps_myapp_my_images.zip
    It's replaced the slashes with underscores. What's going on? The zip file resides in the root folder of my app. The servlet is in a subfolder called "fpauto".

    Ah, ok. Right, so when you set that heading what you are saying to the client is: "The response from this web request is actually a file with the following name..."
    For example you could set it to be README.TXT and then use
    response.getWriter().println("Hello World.");as the only other line of your servlet. That would send a text "file" called README.TXT to the client containing the text "Hello World" only. Setting that response header doesn't tell the servlet to do anything other than inform the client what filename to use.
    It would be nice if there was a method called "transmit file" or somesuch, but there isn't. The simplest reason why is that if you just want to send a file you can usually provide it directly from the web (or app) server by putting it into the content. For example create a file my_files.zip in the root of your war and it will typically be made available as a file anyway.
    The assumption is that servlets are for generating content not just sending content that already exists.
    However, if you have a good reason for wanting to do this, you can create a loop that reads in the file and sends its contents to the response's output stream. I usually use the commons-io IOUtil [copy |http://commons.apache.org/io/api-1.4/org/apache/commons/io/IOUtils.html#copy(java.io.InputStream,%20java.io.OutputStream)] functions to do this.
    So why do you want to use a servlet to send "static" content?

  • Setting paths for JSPs and Servlets

    I have some java servlets and JSPs lying under a directory structure. I want to deploy them on OC4J. Is there any other way of doing this other than copying my directory structure to the /default-web-app directry etc.. etc..? I mean is it possible to configure OC4J to use any directory as the root directory for a deployed web application or an application. TomCat server can be configured like this but I am unble to configure OC4J. Is there anybody who knows how to do this?

    Yes.
    In server.xml (under the config dir of the oc4j installation) there is an application tag for each web application installed. One parameter for the tag is path, which can be set to anywhere on the filesystem.
    Jonny
    null

  • Issue Setting Paths For Sickbeard

    Hi again everyone.
    Man I am having no end of trouble with my system at the moment. At first I had issues with SABnzbd but finally got it sorted but the thing that I am having a lot of trouble with at the moment is sickbeard. I only installed sickbeard this week from AUR.
    I already have a heap of tv shows that I want to add but I am unable to set the path to them or even add a new show and set the path to there.
    I want to set the path to /home/media/video/TVShows which is on my LVM but I can't get it set. I have even set the permissions at one point to 777 to try and get it to write there but it just won't.
    [media@media ~]$ ls -l / | grep home
    drwxr-xr-x 5 root root 4096 Sep 21 2010 home
    [media@media ~]$ ls -l /home | grep media
    drwxrwx--- 39 media users 4096 Nov 5 16:42 media
    [media@media ~]$ ls -l /home/media | grep video
    drwxrw-rw- 8 media users 103 Nov 5 02:22 video
    [media@media ~]$ ls -l /home/media/video | grep TVShows
    drwxrwxr-x 26 sickbeard users 4096 Nov 2 23:02 TVShows
    [media@media ~]$
    I'm just not sure how to solve this one and am hoping someone can help me get it solved.
    Last edited by morphjk (2011-11-05 10:05:14)

    Yes.
    In server.xml (under the config dir of the oc4j installation) there is an application tag for each web application installed. One parameter for the tag is path, which can be set to anywhere on the filesystem.
    Jonny
    null

  • How to set paths for  bc4j Project in release 2

    Hi
    I have a workspace with 2 projects 1 bc4j and the other contains my jsps etc
    They were created in JDev9i RC
    I have recreated my connections in release 2
    I have opened the projects in Release 2 I am trying to run the bc4j Project to test if all is working in release 2 and I got a whole host of errors like:
    -jsp files must reside in the server root directory or a subdirectory beneath it
    -cannot access directory javax\servlet\jsp : verify that directory is reachable from classpath and \or sourcepath
    -cannot access class oracle.jsp.runtime.HttpJsp : file oracle\jsp\runtime\Http.Class not found
    It seems like there is something I need to specify in the classpath /path
    but I am not sure what
    Any one know?
    thanks

    Hi
    Thanks for your response
    The bc4j project compiles and runs fine now
    but I am still getting a runtime error
    when I run the jsp project
    the error is
    JBO-33001: Cannot find the configuration file /IntranetPackage2/common/bc4j.xcfg in the classpath
    I have tried including that path in the java source path but still no effect
    It appears there is a little snag at each step of the way

  • When customising toolbar item only stays for current session, missing when Firefox is reopened

    I want to add a 'Bookmarks' icon next to the 'Refresh' icon on the tool bar. When I customise and then click 'Done' the icon appears and functions correctly. The icon stays for the open session with Firefox. However after closing and then reloading the icon is not there. Any ideas please.

    See this: <br />
    https://support.mozilla.com/en-US/kb/Preferences+are+not+saved

  • How to set Path for a properties file

    Hi,
    I am using a SQL.properties file to load all my SQL statements to my EJB JDBC prepared Statement. I have placed the SQL.properties file in com.company.sql package. I have another SQL class in the same package which is loading the SQL.properties file to cache for future use. I am using the path as "SQL.properties" (the file name straight ) in the SQL class to access the properties file.
    I am using Sun App Server 7. To get access to this file I need to copy the SQL.properties file to the config directory of the app server instance. Otherwise it is not able to locate the file. I don't want to put the properties file in the config directory of the app server instance. Please help me, what path I have to give to access the file from the package itself, rather from the config directory of server instance.
    I think , some one who is doing localization can help me out here. They have to put the localized properties file to access the text out of it. Please help me. Thanks in advance.
    Thanks
    Amit

    I am using the propeties file to get the SQL statements. I have all the SQL query statement in the properties file. I am creating a preparedstatement after getting the statement from the properties file with the id like we do in ResourceBundle. If I keep the properties file in the config directory of the Sun App Server instance , then it is working fine. But If I don't keep it there, then it is giving me a file not found exception.
    My SQL class which is accessing the properties file are in same package (com.company.sql). But still it is not able to find the file. As suggested by you, I tried it by giving the path as com.company.sql.SQL. Still it did not found the file. The file is there inside the WEB-INF/classess/com/company/sql/.
    Thanks
    Amit

  • Set path for native dll in NT

    Hi Javapeople,
    I have a signed applet which downloads a dll to the client machine for JNI access. I was wondering if there is a way to specify that the dll goes to some folder other than 'C:\WINNT\system32' and still have it accessible from my Java code?
    Thanking you in advance.

    so long as the dll is in a directory in your PATH, it will be found.

Maybe you are looking for