if…else…if statement (command not found error)

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











up vote
-5
down vote

favorite












Can someone tell me what is wrong with this loop?



enter image description here



The error that I have is on the line 107 (first line of the loop). It says:




[V2016057174800: command not found.




I am trying to associate two the same filename from two different documents (if that makes sense).










share|improve this question



















  • 4




    [ is a command itself, and needs a space after it (you'll also need a space before the ]). Please paste in text instead of using a screenshot, too.
    – drewbenn
    Jul 12 '17 at 19:44














up vote
-5
down vote

favorite












Can someone tell me what is wrong with this loop?



enter image description here



The error that I have is on the line 107 (first line of the loop). It says:




[V2016057174800: command not found.




I am trying to associate two the same filename from two different documents (if that makes sense).










share|improve this question



















  • 4




    [ is a command itself, and needs a space after it (you'll also need a space before the ]). Please paste in text instead of using a screenshot, too.
    – drewbenn
    Jul 12 '17 at 19:44












up vote
-5
down vote

favorite









up vote
-5
down vote

favorite











Can someone tell me what is wrong with this loop?



enter image description here



The error that I have is on the line 107 (first line of the loop). It says:




[V2016057174800: command not found.




I am trying to associate two the same filename from two different documents (if that makes sense).










share|improve this question















Can someone tell me what is wrong with this loop?



enter image description here



The error that I have is on the line 107 (first line of the loop). It says:




[V2016057174800: command not found.




I am trying to associate two the same filename from two different documents (if that makes sense).







bash shell






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 12 '17 at 19:53









Stephen Rauch

3,258101328




3,258101328










asked Jul 12 '17 at 19:29









dia.duran

13




13







  • 4




    [ is a command itself, and needs a space after it (you'll also need a space before the ]). Please paste in text instead of using a screenshot, too.
    – drewbenn
    Jul 12 '17 at 19:44












  • 4




    [ is a command itself, and needs a space after it (you'll also need a space before the ]). Please paste in text instead of using a screenshot, too.
    – drewbenn
    Jul 12 '17 at 19:44







4




4




[ is a command itself, and needs a space after it (you'll also need a space before the ]). Please paste in text instead of using a screenshot, too.
– drewbenn
Jul 12 '17 at 19:44




[ is a command itself, and needs a space after it (you'll also need a space before the ]). Please paste in text instead of using a screenshot, too.
– drewbenn
Jul 12 '17 at 19:44










1 Answer
1






active

oldest

votes

















up vote
4
down vote













Your formatting is very strange!
You probably want to fix that first to make this code somewhat readable!
That said, your problem is the lack of spaces around [ and ].



These characters [ ] are actually just shorthand for the command test.
You should change the first line to read as follows:



in bash



if [[ "$L1Aname" == "$filename" ]]; then


or



in POSIX shells



if [ "$L1Aname" = "$filename" ]; then


inside both of which examples, each character maters:



For example spaces: there need to be spaces around [ and ].



Plus notice the subtle difference between bash and POSIX in the double / single =.






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',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    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%2f378052%2fif-else-if-statement-command-not-found-error%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    4
    down vote













    Your formatting is very strange!
    You probably want to fix that first to make this code somewhat readable!
    That said, your problem is the lack of spaces around [ and ].



    These characters [ ] are actually just shorthand for the command test.
    You should change the first line to read as follows:



    in bash



    if [[ "$L1Aname" == "$filename" ]]; then


    or



    in POSIX shells



    if [ "$L1Aname" = "$filename" ]; then


    inside both of which examples, each character maters:



    For example spaces: there need to be spaces around [ and ].



    Plus notice the subtle difference between bash and POSIX in the double / single =.






    share|improve this answer


























      up vote
      4
      down vote













      Your formatting is very strange!
      You probably want to fix that first to make this code somewhat readable!
      That said, your problem is the lack of spaces around [ and ].



      These characters [ ] are actually just shorthand for the command test.
      You should change the first line to read as follows:



      in bash



      if [[ "$L1Aname" == "$filename" ]]; then


      or



      in POSIX shells



      if [ "$L1Aname" = "$filename" ]; then


      inside both of which examples, each character maters:



      For example spaces: there need to be spaces around [ and ].



      Plus notice the subtle difference between bash and POSIX in the double / single =.






      share|improve this answer
























        up vote
        4
        down vote










        up vote
        4
        down vote









        Your formatting is very strange!
        You probably want to fix that first to make this code somewhat readable!
        That said, your problem is the lack of spaces around [ and ].



        These characters [ ] are actually just shorthand for the command test.
        You should change the first line to read as follows:



        in bash



        if [[ "$L1Aname" == "$filename" ]]; then


        or



        in POSIX shells



        if [ "$L1Aname" = "$filename" ]; then


        inside both of which examples, each character maters:



        For example spaces: there need to be spaces around [ and ].



        Plus notice the subtle difference between bash and POSIX in the double / single =.






        share|improve this answer














        Your formatting is very strange!
        You probably want to fix that first to make this code somewhat readable!
        That said, your problem is the lack of spaces around [ and ].



        These characters [ ] are actually just shorthand for the command test.
        You should change the first line to read as follows:



        in bash



        if [[ "$L1Aname" == "$filename" ]]; then


        or



        in POSIX shells



        if [ "$L1Aname" = "$filename" ]; then


        inside both of which examples, each character maters:



        For example spaces: there need to be spaces around [ and ].



        Plus notice the subtle difference between bash and POSIX in the double / single =.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Oct 1 at 13:49









        Vlastimil

        6,8871149124




        6,8871149124










        answered Jul 12 '17 at 19:50









        rlf

        403111




        403111



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f378052%2fif-else-if-statement-command-not-found-error%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

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

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay