Variable substitution in the environment.plist file

I want an additional item in the PATH environment variable for GUI-launched apps. I've created the ~/.MacOSX/environment.plist file and added an entry to create a PATH variable. I have initially tried to set the value of this to
"$(PATH):/usr/local"
in an attempt to append the /usr/local folder to the path. However, the PATH value appears to be exactly what I've set it to - without the substitution.
1) Is there a way to get the existing value substituted in?
2) As I'm always out to learn new things, is there a better way of achieving this?
(My fundamental problem is that I have written a plugin for XCode and I'm trying to not hard code the location of a compiler into it. Therefore I thought I'd use the PATH variable to let me find it. However the default PATH value doesn't include /usr/local which is where the compiler is located. So I'm looking for a way to add this folder into the PATH value, and the ~/.MacOSX/environment.plist seemed to be what I wanted - as long as I can get the substitution going. Otherwise I have to hard code the path into THAT file which I feel is just as bad!).
Thanks
Susan

Hi Susan,
   I'm sorry; I didn't mean to imply that this is the wrong place to ask the question. I hope that it's the best place. I was just trying to explain, mostly to myself, why everyone assumes that the part of the system that reads the environment.plist will behave like a shell.
   If you were worried about hard-coding the path on your own machine, I would say that you needn't worry. The only path that exists prior to the setting of environment variables from the environment.plist is hard-coded into the system somewhere. A while back someone found it but that's not really important. If you want to start with that default, you can. If you need to know what it is, I'm sure that we can find it for you somewhere. I assume it's along the lines of:
/usr/bin:/bin:/usr/sbin:/sbin
   While I'm not telling you to not do it, I suggest that you rethink setting the user's path an environment.plist. Changing the environment of every last one of a user's processes "behind the back" of the user seems a bit presumptuous. It wouldn't be a problem if you set a variable that no other app could recognize but if you added something to my path, my first thought would be to look there for a trojan horse. I would eventually realize that it was misguided instead of malicious but I wouldn't like it. It also stands some chance of changing the behavior of a user's UNIX applications.
   If you distribute an environment.plist file with your plugin, you would also have to address the issue of users that already have such files. Thus, it would seem that you would need to do a little checking in an install script. That being the case, you could evaluate the user's PATH variable in that script and use it to hard-code the path in an environment.plist that you generate programmatically from the install script at runtime. Such a script would also give you the opportunity to ask the user if he wants an environment.plist file.
   Of course that approach would make it difficult for a user to remove an element from his path; it wouldn't be sufficient to cease adding the element to the path in the user's shell startup scripts. You would probably be better off using the default path. That might not interfere with changes the user makes in his shell startup scripts but it would mine. You added /usr/local/bin to the end of a user's path. My startup scripts only add path elements if they aren't already there. However, I want /usr/local/bin in front of the default part of my path so your change would alter the behavior of my system.
   If you want to change the environment of a single application, it is common to "wrap" its invocation in a script that sets the environment before invoking the application. However, I'm not sure how that would work with an Xcode plugin.
Gary
~~~~
   There are only 10 kinds of people in the world. Those
   who understand binary numbers and those who don't.

Similar Messages

  • ORA-04054 : using variable substitution for the database link name

    Hi,
    I need to use variable substitution for the database link name.
    Here is my command :
    declare
    GET VARCHAR2(50);
    begin
    select OIA_GET_DESIGNATION into GET from INFODRI.OMA_IN_ARTICLES;
    for rec in (select * from [email protected]_GET_DESIGNATION)
    LOOP
    dbms_output.put_line('TEN_CODE vaut : '||rec.ten_code);
    END LOOP;
    exception
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('ERREUR ORACLE DETECTEE : '||rec.OIR_CUR);
    DBMS_OUTPUT.PUT_LINE('Message Erreur : '||SUBSTR(SQLERRM,1,245));
    :crd := -1;
    end;
    When I run this programm, I receive the error :
    ORA-04054: database link REC.OIA_GET_DESIGNATION does not exist
    When I replace :
    for rec in (select * from [email protected]_GET_DESIGNATION)
    by :
    for rec in (execute immediate 'select * from tensions@'||rec.OIA_GET_DESIGNATION)
    I receive the error :
    PLS-00103 : Encountered the symbol "IMMEDIATE" while parsing.
    What can I do to resolv my problem ?
    Regards,
    Rachel

    What is the name of the DB Link and the name of the object you are selecting
    from?
    I find it easier to create a view on the remote object then use that in selects.
    e.g,
    Link Name = MyLink
    Object_name = Addr_Loc
    create or replace VIEW Rem_Addr_Loc AS
    select * from addr_loc@mylink;
    In the code I then use the view
    begin
      for C_Rec in (select * from Rem_Addr_loc)
      loop
         dbms_output.put_line('Rec: '|| C_Rec.Col1);
      end loop;
    end;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • What does the HSTS.plist file in the Cookies folder in /Library ?

    What does the HSTS.plist file in the Cookies folder in /Library ?
    If I open it in TextEdit it is filled with sites I never have visited.
    Does anybody know where this file is used for ?
    Thanks

    I also have this file in the same folder in the same location with two other 'documents' called:
    1. com.apple.appstore.cookies
    2. Cookies.binarycookies
    Document type shows as 'OOPlistDocumentType'.
    Yes lots of website addresses and at least one known spam tel number. The top line of the text when opened by TexEdit is as follows:
    bplist00“   ∑_ )com.apple.CFNetwork.defaultStorageSession_ !hstsd Disk Storage Schema Versionfl ±    
    This is a bit of a worry ........

  • How do you edit the raw.plist file in 10.5.7? Old tricks no longer working.

    I have a Canon PowerShot S50 that I has the samw RAW profile as the Canon PowerShot S60.
    I've successfully added it to the raw.plist file and updated the CodeResources file with a new key via terminal, and now aperture displays the thumbnail, and very briefly the larger 'image' in my second monitor, but then within a second it reverts to 'unsupported file type'.
    Has anyone found a solution to this?
    Someone seems to have found a fix on this forum for a different camera, but I'm still struggling (and I've tried renaming the camera name with and without space/underscores, etc)
    (Why Apple hasn't added some of these cameras by now is beyond me - that such simple additions haven't been made is totally inexplicable.)
    Thanks for any help!

    I have a Canon PowerShot S50 that I has the samw RAW profile as the Canon PowerShot S60.
    I've successfully added it to the raw.plist file and updated the CodeResources file with a new key via terminal, and now aperture displays the thumbnail, and very briefly the larger 'image' in my second monitor, but then within a second it reverts to 'unsupported file type'.
    Has anyone found a solution to this?
    Someone seems to have found a fix on this forum for a different camera, but I'm still struggling (and I've tried renaming the camera name with and without space/underscores, etc)
    (Why Apple hasn't added some of these cameras by now is beyond me - that such simple additions haven't been made is totally inexplicable.)
    Thanks for any help!

  • Where are the iTunes plist files

    I changed to Lion.  Because the OS I started from had corrupt files I opted to partition and create a clean instal.  Because of the corruption on the old system I do not want to use file migration.  The only two things I need to move are my .plist files for iTunes and iPhoto, which I can find on the old system but not on Lion. 
    I unlocked the hidden files but I can't find the library or the prefernce folder in which to place the old .plist files.  Where is it?  Does anyone know?

    The Library is Hidden in Lion.  Finder Menubar/Hold the Option key/Go/Library
    Files will be in ~/Library/Preferences

  • Variable substitution not working for dynamic file name in Receiver File CC

    Hi Experts,
    I am doing the scenario of Proxy sender to File receiver and my purpose is to Create the text file
    as per the filename available in Source Message payload.
    I am using the Variable Substitution method for this as shown below.
    Source Message Structure:-
         <Row>            -
    having Cocurence 1.1
             <Filename>     -
    having Cocurence 1.1
             <Item>            -
    having Cocurence 1.Unbounded
              <Field1>
              <field2>
             <Item>
             <Item>
              <Field1>
              <field2>
                <Item>        
         <Row>
    Target structure is same as the source structure and i have mapped the Filename field of the Source
    with the Target structure Filename.
    In ID the following is the File receiver CC Configuration.
    File Name Scheme:- %Dyn_filename%
    In Advance tab, I have selected the Enable option and added one row as Variable name %Dyn_filename%
    and Reference as payload:Row,1,Filename,1
    In testing I am getting the Error as 'variable Dyn_filename is not found in Message payload'.
    Please suggest me.
    Regards,
    Jagesh

    Hi Pooja,
    Hi Pooja,
    Thanks for your valuable reply..
    I  tried with the same. but still Filename is appearing in Output file.Giving you some details regarding my Receiver File Configuration settings.
    Target Message Type:-
              <MT_Target_Struct>
                    <Row>----
    1.1 occurence
                            <Filename_test>----
    1.1 occurence
                            <ITEM>----
    1.unbounded occurence
                                  <Field1>
                                  <Field2>
                            <ITEM>
                            <ITEM>
                                  <Field1>
                                  <Field2>
                            <ITEM>
                    <Row>
              <MT_Target_Struct>
    Recordset structure:-  Row,Filename_test,ITEM
    Row.fieldSeparator----
    >'nl'
    Filename_test.fieldFixedLengths----
    >0  (Zero)
    Filename_test.fixedLengthTooShortHandling----
    >Cut
    ITEM.fieldSeparator----
    >,
    ITEM.endSeparator----
    >'nl'
    I want only ITEM node to be written in the output file.
    Please suggest.
    Regards,
    Jagesh

  • Variable substitution: (delete leading zeros from file name)

    Hi All,
    I am configuring an IDOC to FILE (fcc scenario) with a requirement of using the IDOC number in the output file name. 
    Using variable substitution, I manged to get the IDOC number from incoming Idoc-control record but it comes in its entitre length with a few leading zeroes like '00000001234'.
    So my output file name looks like 'Output_000000001234.txt'  . I want it to be like 'Output_1234.txt'.
    Is it possible to achieve it ?
    Thanks
    Shirin

    Hi Shirin,
    First supress the leading zeros of IDOC number by using the following code:
    Create a user defined funciton zerosuppress and take the cache as value and take one argument input. Then put the code below:
    //write your code here
    String output = input.replaceFirst("^0+","");
    return output;
    Then use variable substitution for generating ur IDOC number in the out put file name.
    Regards,
    Vinod.

  • Variable Substitution - dynamic names in receiver file adapter :)

    Hi,
    anyone tried this new feature yet?
    Variable Substitution
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    I hope it's working fine it may be a good answer to many questions on the forum:)
    I can't wait till I get my hands on XI SP12:)
    if anyone has a document the describes <b>all</b> of the changes that came with sp12 please post the link
    Regards,
    michal
    Message was edited by: Michal Krawczyk

    Hi,
    I can't wait to test the new test tool
    http://help.sap.com/saphelp_nw04/helpdata/en/6b/874a4273bb3830e10000000a155106/content.htm
    it looks like a very helpful thing
    come on, come on I want my sp12:)
    Regards,
    michal

  • Where is the iphoto plist file in Mountain Lion

    I upgraded to ML and iPhoto 9.3.2 and imported a few GB of photos. After the import iPhoto started crashing. It seems like the first step is to delete the plist file but I can't find it in ML. Anyone know where it is?

    Usually would be found in the /Home/Library/Preferences/ folder. However, that particular Library folder is invisible. You can make it visible:
    Open the Terminal in the Utilities folder. Paste the following line at the prompt:
    chflags nohidden ~/Library
    Press RETURN.
    You should then be able to peak inside the preferences folder.

  • How to send HTML email with variable substitution in the email body section?

    Does anyone have some scripting examples that create a HTML formatted e-mail with the ability to have some fields be variables?
    I'm familiar with updating a XML document using a template file and the "keyword transform" function in the script.
    (Like setting an emergency close for a queue for example)
    I've also successfully written a script that sends an e-mail with a .wav file attachment.  I think I have the basics down on the e-mail part.
    Using the keyword transform gives me an xml document that shows the tags as well as the desired variable.  Functional but not very attractive
    The issue I'm really struggling with is the formatting of the e-mail body.
    Is there a way to have a "prettier" document with some basic HTML tags that allow the same function?
    For example I'd like a sentence in the body of the e-mail to say
    "Call received from number <VariableOfCallingNumber>  at <TimeVariable>
    I can do this in the subject easily enough but adding together some strings and variables. 
    I could do the same thing in the e-mail body DOC[], but as I understand it, I could only get 1 line so it would be pretty limited
    Can anyone point me in the correct direction?
    Thanks !!

    sorry, not possible
    http://stackoverflow.com/questions/5620324/mailto-with-html-body
    https://www.google.com/search?rlz=1C1CHFX_enUS566US566&{google:acceptedSuggestion}oq=mailto+with+mime+type&sourceid=chro…

  • Variables to pass the input CSV file names

    Hi,
    I have created an interface source from 2 different CSV files.
    Do I need to generate 2 different scenarios or one scenario with variable to pass 2 file names one after the other
    2 CSVs are of same type
    Thanks for the help

    Step1. Create an Interface and load first file and test if that is working fine.
    Step 2. Change the resource Name in File to Variable
    Step 3. Set variable pass the file 1 and call interface 1 and set variable again with File 2 and call Interface and run the package.
    This way you can use the same interface to load file with same structure.
    In case you need to carry this same logic with multiple file then
    Declare variable and call interface and package and create scenario. Now trigger the scenario and pass the file name.

  • Variable Substitution for IDOC-XML-Flat File

    Hello
    I have a scenario where I need to populate the Idoc number into my file name. the Source is an Idoc and the Target is XML but the target is then converted to an Flatfile via a module in the processing sequence. When I try to use the variable sub method it errors out as the final target structure is a flat file and not the XML structure that I hav used in the graphical mapping. Any help on how I can go abut doing this will be greatly appreciate.
    Thanks
    Lavanya

    IF I remove my adapter that converts the XML file to Flat file from the module sequence this works perfectly. So is there a way for me to now read the xml file for the target file name in variable sub. but still have the Flat file structure derived for the processing seq.

  • Variable Substitution not working for multiple files

    Hi,
    Have a scenario in which we are using Interface Collection with multiple files as output.
    The naming of the files is derived from a payload field as follows.
    payload:MT_OrdersAck,1,Order,1,File_Header,1,StoreNo,1
    When the first file is generated this works fine, but fails for the rest of the files.
    I guess this is because of the hardcoding 1 in 
    payload:MT_OrdersAck,1,Order,1,File_Header,1,StoreNo,1
    how do we get around this problem?
    Any Ideas?

    Hi, I suppose you are using Mapping-Based Message Split, right? Do the following files look the same like the first file with respect to File_Header?
    Make sure that the payload structure (payload:MT_OrdersAck,1,Order,1,File_Header,1,StoreNo,1) is equal in all files and that first occurrence of StoreNo always has a value in all the files.
    Regards, Martin

  • Variable being overwritten in the Variable Substitution (File Adapter)

    In the File adapter Receiver Communication Channel, I am using variable substitution.
    The problem is that the first variable I use (userid) is being overwritten by the second variable (filenumber). How can I fix this problem?
    File Name Scheme: %userid%_%filenumber%.xls
    Target XML:
    ============
    <?xml version="1.0" encoding="UTF-8"?>
    <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40">
    <Worksheet ss:Name="FileName">
    <Table x:FullColumns="1" x:FullRows="1">
      <Row>
        <Cell><Data ss:Type="String">0209519</Data></Cell>
        <Cell><Data ss:Type="String">32226v2 v1.1</Data></Cell>
      </Row>
    Variable Substitution:
    =======================
    userid          payload:Workbook,1,Worksheet,1,Table,1,Row,1,Cell,1,Data,1
    filenumber    payload:Workbook,1,Worksheet,1,Table,1,Row,1,Cell,2,Data,1
    Expected Output:
    ==============
    0209519_32226v2 v1.1
    Actual Output:
    ============
    32226v2 v1.1_32226v2 v1.1
    Thanks for your help.

    Thank you for all your suggestions. I decided to modify my target XML and concantinate all the fields into one string so I don't have to worry about the variables being overwritten in the variable substitution.
    Target XML:
    ============
    <?xml version="1.0" encoding="UTF-8"?>
    <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40">
    <Worksheet ss:Name="FileName">
    <Table x:FullColumns="1" x:FullRows="1">
    <Row>
    <Cell><Data ss:Type="String">0209519_32226v2 v1.1</Data></Cell>
    </Row>
    Variable Substitution:
    =======================
    filename payload:Workbook,1,Worksheet,1,Table,1,Row,1,Cell,1,Data,1
    Expected Output:
    ==============
    0209519_32226v2 v1.1
    Actual Output:
    ============
    0209519_32226v2 v1.1

  • Used variable substitution to substiture the field 'date' in file name

    Hi gurus
    I have used variable substitution to substiture the field 'date' (dd/MM/yyyy/hh/mm/ss) in the file name so when empty payload (a valid xml ) is generated by Message mapping then the communication channel is failing by showing the following error
    File processing failed with com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during
    variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload
    : date
    As of now the business is not getting effected as the business scenarion needs only customer master data at the reciever side But when ever there is no custmer master data in the sourse side the message mapping is generating an empty payload and the communication channel is failing ( so it is an internal issue and is there any way which could solve the both (ie the business must not get effected and as well the communication channel must not fail)
    any coments on this will be higly apreciated
    thanks and regards
    sandeep

    Hi Sandeep -
    Yes If you use the Variable substitution from the payload , that perticular field has to be generated in the target structure.
    To handle this You can do the following:
    Sourcefield --->exists -> IfThenElse-->TargetField
    Where     SourceField>exists(node function)-> If
                   SourceField -
    >Then
                   CurrentDate(Date Function)----->Else
    Hope this will help !!
    Regards.
    Jeet.

Maybe you are looking for