“Permission denied” while running a bash script





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















I'm new to linux, coding and generally computer sciences. I am trying to run a bash script, but I get this error:



./fastalign_train.sh: line 5: /forward.align: Permission denied
./fastalign_train.sh: line 6: /reverse.align: Permission denied


There are two txt files (forward.align and reverse.align):
ls -l result:



-rwxr-xr-x 1 tara tara      72 Feb 12 08:05 reverse.align
-rwxr-xr-x 1 tara tara 76 Feb 12 08:05 forward.align
-rwxr-xr-x 1 tara tara 2089888 Feb 11 03:00 fast_align
-rwxrwxrwx 1 tara tara 242 Feb 11 12:32 fastalign_train.sh


Any idea? Thank you guys!










share|improve this question































    1















    I'm new to linux, coding and generally computer sciences. I am trying to run a bash script, but I get this error:



    ./fastalign_train.sh: line 5: /forward.align: Permission denied
    ./fastalign_train.sh: line 6: /reverse.align: Permission denied


    There are two txt files (forward.align and reverse.align):
    ls -l result:



    -rwxr-xr-x 1 tara tara      72 Feb 12 08:05 reverse.align
    -rwxr-xr-x 1 tara tara 76 Feb 12 08:05 forward.align
    -rwxr-xr-x 1 tara tara 2089888 Feb 11 03:00 fast_align
    -rwxrwxrwx 1 tara tara 242 Feb 11 12:32 fastalign_train.sh


    Any idea? Thank you guys!










    share|improve this question



























      1












      1








      1








      I'm new to linux, coding and generally computer sciences. I am trying to run a bash script, but I get this error:



      ./fastalign_train.sh: line 5: /forward.align: Permission denied
      ./fastalign_train.sh: line 6: /reverse.align: Permission denied


      There are two txt files (forward.align and reverse.align):
      ls -l result:



      -rwxr-xr-x 1 tara tara      72 Feb 12 08:05 reverse.align
      -rwxr-xr-x 1 tara tara 76 Feb 12 08:05 forward.align
      -rwxr-xr-x 1 tara tara 2089888 Feb 11 03:00 fast_align
      -rwxrwxrwx 1 tara tara 242 Feb 11 12:32 fastalign_train.sh


      Any idea? Thank you guys!










      share|improve this question
















      I'm new to linux, coding and generally computer sciences. I am trying to run a bash script, but I get this error:



      ./fastalign_train.sh: line 5: /forward.align: Permission denied
      ./fastalign_train.sh: line 6: /reverse.align: Permission denied


      There are two txt files (forward.align and reverse.align):
      ls -l result:



      -rwxr-xr-x 1 tara tara      72 Feb 12 08:05 reverse.align
      -rwxr-xr-x 1 tara tara 76 Feb 12 08:05 forward.align
      -rwxr-xr-x 1 tara tara 2089888 Feb 11 03:00 fast_align
      -rwxrwxrwx 1 tara tara 242 Feb 11 12:32 fastalign_train.sh


      Any idea? Thank you guys!







      command-line bash permissions scripts






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 12 at 5:56









      vidarlo

      10.7k52852




      10.7k52852










      asked Feb 12 at 5:50









      Z AzinZ Azin

      82




      82






















          1 Answer
          1






          active

          oldest

          votes


















          2














          The hint is in the filename shown: /forward.align



          This implies that you try to write to /forward.align, which is in the root (/) of the file system. Users do not have write permissions there.



          Replace /forward.align with either ./forward.align or forward.align., and same for /reverse.align, and it should work.






          share|improve this answer
























          • Yes, it runs now but there is no output...like nothing happens. this is the main line of my bash code: ${FASTALIGN}/fast_align -i $1 -d -o -v -p $2/fwd_params > $2./forward.align 2>$2./fwd_err

            – Z Azin
            Feb 12 at 6:25






          • 1





            Post a new question if you have a new question. If you want help debugging, include all of your script.

            – vidarlo
            Feb 12 at 6:27












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          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: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          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%2faskubuntu.com%2fquestions%2f1117565%2fpermission-denied-while-running-a-bash-script%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









          2














          The hint is in the filename shown: /forward.align



          This implies that you try to write to /forward.align, which is in the root (/) of the file system. Users do not have write permissions there.



          Replace /forward.align with either ./forward.align or forward.align., and same for /reverse.align, and it should work.






          share|improve this answer
























          • Yes, it runs now but there is no output...like nothing happens. this is the main line of my bash code: ${FASTALIGN}/fast_align -i $1 -d -o -v -p $2/fwd_params > $2./forward.align 2>$2./fwd_err

            – Z Azin
            Feb 12 at 6:25






          • 1





            Post a new question if you have a new question. If you want help debugging, include all of your script.

            – vidarlo
            Feb 12 at 6:27
















          2














          The hint is in the filename shown: /forward.align



          This implies that you try to write to /forward.align, which is in the root (/) of the file system. Users do not have write permissions there.



          Replace /forward.align with either ./forward.align or forward.align., and same for /reverse.align, and it should work.






          share|improve this answer
























          • Yes, it runs now but there is no output...like nothing happens. this is the main line of my bash code: ${FASTALIGN}/fast_align -i $1 -d -o -v -p $2/fwd_params > $2./forward.align 2>$2./fwd_err

            – Z Azin
            Feb 12 at 6:25






          • 1





            Post a new question if you have a new question. If you want help debugging, include all of your script.

            – vidarlo
            Feb 12 at 6:27














          2












          2








          2







          The hint is in the filename shown: /forward.align



          This implies that you try to write to /forward.align, which is in the root (/) of the file system. Users do not have write permissions there.



          Replace /forward.align with either ./forward.align or forward.align., and same for /reverse.align, and it should work.






          share|improve this answer













          The hint is in the filename shown: /forward.align



          This implies that you try to write to /forward.align, which is in the root (/) of the file system. Users do not have write permissions there.



          Replace /forward.align with either ./forward.align or forward.align., and same for /reverse.align, and it should work.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 12 at 5:58









          vidarlovidarlo

          10.7k52852




          10.7k52852













          • Yes, it runs now but there is no output...like nothing happens. this is the main line of my bash code: ${FASTALIGN}/fast_align -i $1 -d -o -v -p $2/fwd_params > $2./forward.align 2>$2./fwd_err

            – Z Azin
            Feb 12 at 6:25






          • 1





            Post a new question if you have a new question. If you want help debugging, include all of your script.

            – vidarlo
            Feb 12 at 6:27



















          • Yes, it runs now but there is no output...like nothing happens. this is the main line of my bash code: ${FASTALIGN}/fast_align -i $1 -d -o -v -p $2/fwd_params > $2./forward.align 2>$2./fwd_err

            – Z Azin
            Feb 12 at 6:25






          • 1





            Post a new question if you have a new question. If you want help debugging, include all of your script.

            – vidarlo
            Feb 12 at 6:27

















          Yes, it runs now but there is no output...like nothing happens. this is the main line of my bash code: ${FASTALIGN}/fast_align -i $1 -d -o -v -p $2/fwd_params > $2./forward.align 2>$2./fwd_err

          – Z Azin
          Feb 12 at 6:25





          Yes, it runs now but there is no output...like nothing happens. this is the main line of my bash code: ${FASTALIGN}/fast_align -i $1 -d -o -v -p $2/fwd_params > $2./forward.align 2>$2./fwd_err

          – Z Azin
          Feb 12 at 6:25




          1




          1





          Post a new question if you have a new question. If you want help debugging, include all of your script.

          – vidarlo
          Feb 12 at 6:27





          Post a new question if you have a new question. If you want help debugging, include all of your script.

          – vidarlo
          Feb 12 at 6:27


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • 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%2faskubuntu.com%2fquestions%2f1117565%2fpermission-denied-while-running-a-bash-script%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

          Questions related to Moebius Transform of Characteristic Function of the Primes

          List of scandals in India

          Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?