Whether wild card symbol can be added to path variable?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












0















Scenario:



Parent folder contains, many sub-folders (say in a few hundreds) containing executables or source programs. Say, parent folder, bin contains many sub-folders, mod1, mod2, ... modn (for example, /opt/app1/bin/ with sub-folders mod1, mod2, mod3, ...., modn). Adding all them to path variable may exceed the path character/line limit or could be very clumsy!



It is understood from dogbane's answer at what is wild card to select all directories in a directory that:

a) wild card */ can be used to match directories and

b) wild card **/*/ can be used to match directories and sub-directories.



Whether adding entry /opt/app1/bin/**/*/ to PATH variable, will search the executables in the sub-folders? Will there be any complications, by doing so?










share|improve this question
























  • Note that $PATH must be a :-delimited list of directory paths. A shell glob won't expand (directly) into such a list.

    – Kusalananda
    Mar 6 at 12:24











  • In what way are you adding /opt/app1/bin/**/*/ to the PATH? As that explicit string, or in the context of a wildcard expansion? Just so we focus on the right thing in this question.

    – Jeff Schaller
    Mar 6 at 12:50











  • the context is wild card expansion. ie. whould search in all the sub-directories.

    – AVA
    Mar 6 at 12:56






  • 1





    The more correct solution is to link (ln) all executables into one folder

    – user1133275
    Mar 6 at 13:05















0















Scenario:



Parent folder contains, many sub-folders (say in a few hundreds) containing executables or source programs. Say, parent folder, bin contains many sub-folders, mod1, mod2, ... modn (for example, /opt/app1/bin/ with sub-folders mod1, mod2, mod3, ...., modn). Adding all them to path variable may exceed the path character/line limit or could be very clumsy!



It is understood from dogbane's answer at what is wild card to select all directories in a directory that:

a) wild card */ can be used to match directories and

b) wild card **/*/ can be used to match directories and sub-directories.



Whether adding entry /opt/app1/bin/**/*/ to PATH variable, will search the executables in the sub-folders? Will there be any complications, by doing so?










share|improve this question
























  • Note that $PATH must be a :-delimited list of directory paths. A shell glob won't expand (directly) into such a list.

    – Kusalananda
    Mar 6 at 12:24











  • In what way are you adding /opt/app1/bin/**/*/ to the PATH? As that explicit string, or in the context of a wildcard expansion? Just so we focus on the right thing in this question.

    – Jeff Schaller
    Mar 6 at 12:50











  • the context is wild card expansion. ie. whould search in all the sub-directories.

    – AVA
    Mar 6 at 12:56






  • 1





    The more correct solution is to link (ln) all executables into one folder

    – user1133275
    Mar 6 at 13:05













0












0








0








Scenario:



Parent folder contains, many sub-folders (say in a few hundreds) containing executables or source programs. Say, parent folder, bin contains many sub-folders, mod1, mod2, ... modn (for example, /opt/app1/bin/ with sub-folders mod1, mod2, mod3, ...., modn). Adding all them to path variable may exceed the path character/line limit or could be very clumsy!



It is understood from dogbane's answer at what is wild card to select all directories in a directory that:

a) wild card */ can be used to match directories and

b) wild card **/*/ can be used to match directories and sub-directories.



Whether adding entry /opt/app1/bin/**/*/ to PATH variable, will search the executables in the sub-folders? Will there be any complications, by doing so?










share|improve this question
















Scenario:



Parent folder contains, many sub-folders (say in a few hundreds) containing executables or source programs. Say, parent folder, bin contains many sub-folders, mod1, mod2, ... modn (for example, /opt/app1/bin/ with sub-folders mod1, mod2, mod3, ...., modn). Adding all them to path variable may exceed the path character/line limit or could be very clumsy!



It is understood from dogbane's answer at what is wild card to select all directories in a directory that:

a) wild card */ can be used to match directories and

b) wild card **/*/ can be used to match directories and sub-directories.



Whether adding entry /opt/app1/bin/**/*/ to PATH variable, will search the executables in the sub-folders? Will there be any complications, by doing so?







linux path






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 6 at 12:31







AVA

















asked Mar 6 at 12:15









AVAAVA

1175




1175












  • Note that $PATH must be a :-delimited list of directory paths. A shell glob won't expand (directly) into such a list.

    – Kusalananda
    Mar 6 at 12:24











  • In what way are you adding /opt/app1/bin/**/*/ to the PATH? As that explicit string, or in the context of a wildcard expansion? Just so we focus on the right thing in this question.

    – Jeff Schaller
    Mar 6 at 12:50











  • the context is wild card expansion. ie. whould search in all the sub-directories.

    – AVA
    Mar 6 at 12:56






  • 1





    The more correct solution is to link (ln) all executables into one folder

    – user1133275
    Mar 6 at 13:05

















  • Note that $PATH must be a :-delimited list of directory paths. A shell glob won't expand (directly) into such a list.

    – Kusalananda
    Mar 6 at 12:24











  • In what way are you adding /opt/app1/bin/**/*/ to the PATH? As that explicit string, or in the context of a wildcard expansion? Just so we focus on the right thing in this question.

    – Jeff Schaller
    Mar 6 at 12:50











  • the context is wild card expansion. ie. whould search in all the sub-directories.

    – AVA
    Mar 6 at 12:56






  • 1





    The more correct solution is to link (ln) all executables into one folder

    – user1133275
    Mar 6 at 13:05
















Note that $PATH must be a :-delimited list of directory paths. A shell glob won't expand (directly) into such a list.

– Kusalananda
Mar 6 at 12:24





Note that $PATH must be a :-delimited list of directory paths. A shell glob won't expand (directly) into such a list.

– Kusalananda
Mar 6 at 12:24













In what way are you adding /opt/app1/bin/**/*/ to the PATH? As that explicit string, or in the context of a wildcard expansion? Just so we focus on the right thing in this question.

– Jeff Schaller
Mar 6 at 12:50





In what way are you adding /opt/app1/bin/**/*/ to the PATH? As that explicit string, or in the context of a wildcard expansion? Just so we focus on the right thing in this question.

– Jeff Schaller
Mar 6 at 12:50













the context is wild card expansion. ie. whould search in all the sub-directories.

– AVA
Mar 6 at 12:56





the context is wild card expansion. ie. whould search in all the sub-directories.

– AVA
Mar 6 at 12:56




1




1





The more correct solution is to link (ln) all executables into one folder

– user1133275
Mar 6 at 13:05





The more correct solution is to link (ln) all executables into one folder

– user1133275
Mar 6 at 13:05










1 Answer
1






active

oldest

votes


















0














Yes, adding the expansion of /opt/app1/bin/**/*/ to the PATH variable (assuming you've set corresponding option for your shell to cause ** to expand) will cause executables to be searched for in those directories.



Note that the trailing */ is extraneous here; you can simply use the expansion of /opt/app1/bin/**/ to get the list of all subdirectories under /opt/app1/bin.



I do not see a length limitation in the POSIX specification for $PATH, given in Base Definitions -- Environment Variables -- Other Environment Variables.



The complications I can imagine are:



  • masking of identical commands -- given two identical executable names, the one that's found (and inserted into PATH) first will be the one that's called by default


  • additional delay when failing to find an errant command (as your shell searches all of those directories for it)






share|improve this answer























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f504694%2fwhether-wild-card-symbol-can-be-added-to-path-variable%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Yes, adding the expansion of /opt/app1/bin/**/*/ to the PATH variable (assuming you've set corresponding option for your shell to cause ** to expand) will cause executables to be searched for in those directories.



    Note that the trailing */ is extraneous here; you can simply use the expansion of /opt/app1/bin/**/ to get the list of all subdirectories under /opt/app1/bin.



    I do not see a length limitation in the POSIX specification for $PATH, given in Base Definitions -- Environment Variables -- Other Environment Variables.



    The complications I can imagine are:



    • masking of identical commands -- given two identical executable names, the one that's found (and inserted into PATH) first will be the one that's called by default


    • additional delay when failing to find an errant command (as your shell searches all of those directories for it)






    share|improve this answer



























      0














      Yes, adding the expansion of /opt/app1/bin/**/*/ to the PATH variable (assuming you've set corresponding option for your shell to cause ** to expand) will cause executables to be searched for in those directories.



      Note that the trailing */ is extraneous here; you can simply use the expansion of /opt/app1/bin/**/ to get the list of all subdirectories under /opt/app1/bin.



      I do not see a length limitation in the POSIX specification for $PATH, given in Base Definitions -- Environment Variables -- Other Environment Variables.



      The complications I can imagine are:



      • masking of identical commands -- given two identical executable names, the one that's found (and inserted into PATH) first will be the one that's called by default


      • additional delay when failing to find an errant command (as your shell searches all of those directories for it)






      share|improve this answer

























        0












        0








        0







        Yes, adding the expansion of /opt/app1/bin/**/*/ to the PATH variable (assuming you've set corresponding option for your shell to cause ** to expand) will cause executables to be searched for in those directories.



        Note that the trailing */ is extraneous here; you can simply use the expansion of /opt/app1/bin/**/ to get the list of all subdirectories under /opt/app1/bin.



        I do not see a length limitation in the POSIX specification for $PATH, given in Base Definitions -- Environment Variables -- Other Environment Variables.



        The complications I can imagine are:



        • masking of identical commands -- given two identical executable names, the one that's found (and inserted into PATH) first will be the one that's called by default


        • additional delay when failing to find an errant command (as your shell searches all of those directories for it)






        share|improve this answer













        Yes, adding the expansion of /opt/app1/bin/**/*/ to the PATH variable (assuming you've set corresponding option for your shell to cause ** to expand) will cause executables to be searched for in those directories.



        Note that the trailing */ is extraneous here; you can simply use the expansion of /opt/app1/bin/**/ to get the list of all subdirectories under /opt/app1/bin.



        I do not see a length limitation in the POSIX specification for $PATH, given in Base Definitions -- Environment Variables -- Other Environment Variables.



        The complications I can imagine are:



        • masking of identical commands -- given two identical executable names, the one that's found (and inserted into PATH) first will be the one that's called by default


        • additional delay when failing to find an errant command (as your shell searches all of those directories for it)







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 6 at 13:19









        Jeff SchallerJeff Schaller

        44.6k1162143




        44.6k1162143



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f504694%2fwhether-wild-card-symbol-can-be-added-to-path-variable%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown






            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?