What does (($count+1)) do in this script?What does echo $-1 display?How would I loop this command?What does...

Is it safe to redirect stdout and stderr to the same file without file descriptor copies?

One word for 'the thing that attracts me'?

Why is unzipped directory exactly 4.0K (much smaller than zipped file)?

Paired t-test means that the variances of the 2 samples are the same?

Are there any German nonsense poems (Jabberwocky)?

What is the use case for non-breathable waterproof pants?

How to remove new line added by readarray when using a delimiter?

What could be my risk mitigation strategies if my client wants to contract UAT?

Are there historical examples of audiences drawn to a work that was "so bad it's good"?

Is keeping the forking link on a true fork necessary (Github/GPL)?

Why was this character made Grand Maester?

Why is this integration method not valid?

Is a world with one country feeding everyone possible?

Can a UK national work as a paid shop assistant in the USA?

Are cells guaranteed to get at least one mitochondrion when they divide?

Split into three!

Why Emacs (dired+) asks me twice to delete file?

How does the Earth's center produce heat?

Could a rotating ring space station have a bolo-like extension?

The disk image is 497GB smaller than the target device

Why is the Eisenstein ideal paper so great?

Cisco 3750X Power Cable

Using too much dialogue?

Why did other houses not demand this?



What does (($count+1)) do in this script?


What does echo $-1 display?How would I loop this command?What does “echo (ls)” do in bash?What does echo *?What does #var do?What does mean echo -e e - how escape?How does echo parse $100?What does command “echo run -d” do?What does echo $? do?How does this echo command work? “echo > file.txt Hello”






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







-1















Can anyone tell me what the purpose/action is of this area right here circled in neon green color? I would like to know its purpose in terms of what it does in a script.



enter image description here



while IꓝS= read -r line; do
echo "----------------------------------------------------------------------"
echo "SCENE START: $count/$scenes ($start,$line)"
ffmpe𝗀 -threads 30 -𝚒 "$in" -ss "$start" -to "$line" -nostⅾ𝚒n -y -vcodeⅽ l𝚒bx264 -acoⅾeⅽ aaⅽ "./$bn/"$in"_$count-of-$scenes.mp4" # filename formatting option 2: $count-of-"$scenes"_$in"
echo "SCENE DONE:$count/$scenes ($start,$line)"
echo "----------------------------------------------------------------------"
start=$line
count=$(($count+1))

sleep 0.5

done <"./$bn/timestamps_$in.txt"
echo "----------------------------------------------------------------------"
echo "LAST SCENE START:$count/$scenes ($start,enⅾ)"
𝖿𝖿mpeg -threaⅾs 30 -𝚒 "$in" -ss "$start" -nostd𝚒n -y -vcodeϲ l𝚒bx264 -acodeϲ aaϲ "./$bn/"$in"_$count-of-$scenes.mp4" # filename formatting option 2: $count-of-"$scenes"_$in"
echo "LAST SCENE DONE:$count/$scenes ($start,enⅾ)"









share|improve this question































    -1















    Can anyone tell me what the purpose/action is of this area right here circled in neon green color? I would like to know its purpose in terms of what it does in a script.



    enter image description here



    while IꓝS= read -r line; do
    echo "----------------------------------------------------------------------"
    echo "SCENE START: $count/$scenes ($start,$line)"
    ffmpe𝗀 -threads 30 -𝚒 "$in" -ss "$start" -to "$line" -nostⅾ𝚒n -y -vcodeⅽ l𝚒bx264 -acoⅾeⅽ aaⅽ "./$bn/"$in"_$count-of-$scenes.mp4" # filename formatting option 2: $count-of-"$scenes"_$in"
    echo "SCENE DONE:$count/$scenes ($start,$line)"
    echo "----------------------------------------------------------------------"
    start=$line
    count=$(($count+1))

    sleep 0.5

    done <"./$bn/timestamps_$in.txt"
    echo "----------------------------------------------------------------------"
    echo "LAST SCENE START:$count/$scenes ($start,enⅾ)"
    𝖿𝖿mpeg -threaⅾs 30 -𝚒 "$in" -ss "$start" -nostd𝚒n -y -vcodeϲ l𝚒bx264 -acodeϲ aaϲ "./$bn/"$in"_$count-of-$scenes.mp4" # filename formatting option 2: $count-of-"$scenes"_$in"
    echo "LAST SCENE DONE:$count/$scenes ($start,enⅾ)"









    share|improve this question



























      -1












      -1








      -1








      Can anyone tell me what the purpose/action is of this area right here circled in neon green color? I would like to know its purpose in terms of what it does in a script.



      enter image description here



      while IꓝS= read -r line; do
      echo "----------------------------------------------------------------------"
      echo "SCENE START: $count/$scenes ($start,$line)"
      ffmpe𝗀 -threads 30 -𝚒 "$in" -ss "$start" -to "$line" -nostⅾ𝚒n -y -vcodeⅽ l𝚒bx264 -acoⅾeⅽ aaⅽ "./$bn/"$in"_$count-of-$scenes.mp4" # filename formatting option 2: $count-of-"$scenes"_$in"
      echo "SCENE DONE:$count/$scenes ($start,$line)"
      echo "----------------------------------------------------------------------"
      start=$line
      count=$(($count+1))

      sleep 0.5

      done <"./$bn/timestamps_$in.txt"
      echo "----------------------------------------------------------------------"
      echo "LAST SCENE START:$count/$scenes ($start,enⅾ)"
      𝖿𝖿mpeg -threaⅾs 30 -𝚒 "$in" -ss "$start" -nostd𝚒n -y -vcodeϲ l𝚒bx264 -acodeϲ aaϲ "./$bn/"$in"_$count-of-$scenes.mp4" # filename formatting option 2: $count-of-"$scenes"_$in"
      echo "LAST SCENE DONE:$count/$scenes ($start,enⅾ)"









      share|improve this question
















      Can anyone tell me what the purpose/action is of this area right here circled in neon green color? I would like to know its purpose in terms of what it does in a script.



      enter image description here



      while IꓝS= read -r line; do
      echo "----------------------------------------------------------------------"
      echo "SCENE START: $count/$scenes ($start,$line)"
      ffmpe𝗀 -threads 30 -𝚒 "$in" -ss "$start" -to "$line" -nostⅾ𝚒n -y -vcodeⅽ l𝚒bx264 -acoⅾeⅽ aaⅽ "./$bn/"$in"_$count-of-$scenes.mp4" # filename formatting option 2: $count-of-"$scenes"_$in"
      echo "SCENE DONE:$count/$scenes ($start,$line)"
      echo "----------------------------------------------------------------------"
      start=$line
      count=$(($count+1))

      sleep 0.5

      done <"./$bn/timestamps_$in.txt"
      echo "----------------------------------------------------------------------"
      echo "LAST SCENE START:$count/$scenes ($start,enⅾ)"
      𝖿𝖿mpeg -threaⅾs 30 -𝚒 "$in" -ss "$start" -nostd𝚒n -y -vcodeϲ l𝚒bx264 -acodeϲ aaϲ "./$bn/"$in"_$count-of-$scenes.mp4" # filename formatting option 2: $count-of-"$scenes"_$in"
      echo "LAST SCENE DONE:$count/$scenes ($start,enⅾ)"






      echo video-editing source-code






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 hours ago







      Anonymous User

















      asked 11 hours ago









      Anonymous UserAnonymous User

      937




      937






















          1 Answer
          1






          active

          oldest

          votes


















          3














          It increments the value of the variable count by one.





          The line reads



          count=$(($count+1))


          This is an assignment to the variable count. The value that is assigned is an arithmetic expansion, $(( ... )). The arithmetic expression inside $(( ... )) will be evaluated and the whole arithmetic expansion will be replaced by the resulting value, as a string of digits.



          The arithmetic expression is $count + 1. This evaluates to the value of the variable count, plus one.



          The $ on the variable name is not needed here as it's an arithmetic context. The line could therefore be written as



          count=$(( count + 1 ))




          The effect of this counting in the code is that after the loop, the variable count will hold the number of lines read from the file ./$bn/timestamps_$in.txt.



          The script also stores the count of lines in the variable scenes before the loop, so the echo in the loop will show SCENE START: X/Y with X running from 0 to however many lines there are in the file, minus one (since the increment of count happens at the end of the loop), and where Y is the total number of lines in the file.





          I'm also noticing that you have random non-ASCII characters in the code, such as in 𝖿𝖿mpe𝗀 (instead of ffmpeg; both f and g non-ASCII), and in -nostⅾ𝚒n (instead of -nostdin; i and n non-ASCII). These would likely prevent your script from running correctly.






          share|improve this answer





















          • 2





            @AnonymousUser no, sorry, but on this site we really don't like removing content. While this might have answered your question, the objective here is to build up a resource with useful information for future users. So even if your question is now answered, this answer (and your question) should remain since they might help the next user with the same issue. That's precisely why the system doesn't let you delete your question if it's been answered. So instead of asking Kusalananda to delete, please take a moment and accept this answer instead.

            – terdon
            6 hours ago












          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%2f519953%2fwhat-does-count1-do-in-this-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









          3














          It increments the value of the variable count by one.





          The line reads



          count=$(($count+1))


          This is an assignment to the variable count. The value that is assigned is an arithmetic expansion, $(( ... )). The arithmetic expression inside $(( ... )) will be evaluated and the whole arithmetic expansion will be replaced by the resulting value, as a string of digits.



          The arithmetic expression is $count + 1. This evaluates to the value of the variable count, plus one.



          The $ on the variable name is not needed here as it's an arithmetic context. The line could therefore be written as



          count=$(( count + 1 ))




          The effect of this counting in the code is that after the loop, the variable count will hold the number of lines read from the file ./$bn/timestamps_$in.txt.



          The script also stores the count of lines in the variable scenes before the loop, so the echo in the loop will show SCENE START: X/Y with X running from 0 to however many lines there are in the file, minus one (since the increment of count happens at the end of the loop), and where Y is the total number of lines in the file.





          I'm also noticing that you have random non-ASCII characters in the code, such as in 𝖿𝖿mpe𝗀 (instead of ffmpeg; both f and g non-ASCII), and in -nostⅾ𝚒n (instead of -nostdin; i and n non-ASCII). These would likely prevent your script from running correctly.






          share|improve this answer





















          • 2





            @AnonymousUser no, sorry, but on this site we really don't like removing content. While this might have answered your question, the objective here is to build up a resource with useful information for future users. So even if your question is now answered, this answer (and your question) should remain since they might help the next user with the same issue. That's precisely why the system doesn't let you delete your question if it's been answered. So instead of asking Kusalananda to delete, please take a moment and accept this answer instead.

            – terdon
            6 hours ago
















          3














          It increments the value of the variable count by one.





          The line reads



          count=$(($count+1))


          This is an assignment to the variable count. The value that is assigned is an arithmetic expansion, $(( ... )). The arithmetic expression inside $(( ... )) will be evaluated and the whole arithmetic expansion will be replaced by the resulting value, as a string of digits.



          The arithmetic expression is $count + 1. This evaluates to the value of the variable count, plus one.



          The $ on the variable name is not needed here as it's an arithmetic context. The line could therefore be written as



          count=$(( count + 1 ))




          The effect of this counting in the code is that after the loop, the variable count will hold the number of lines read from the file ./$bn/timestamps_$in.txt.



          The script also stores the count of lines in the variable scenes before the loop, so the echo in the loop will show SCENE START: X/Y with X running from 0 to however many lines there are in the file, minus one (since the increment of count happens at the end of the loop), and where Y is the total number of lines in the file.





          I'm also noticing that you have random non-ASCII characters in the code, such as in 𝖿𝖿mpe𝗀 (instead of ffmpeg; both f and g non-ASCII), and in -nostⅾ𝚒n (instead of -nostdin; i and n non-ASCII). These would likely prevent your script from running correctly.






          share|improve this answer





















          • 2





            @AnonymousUser no, sorry, but on this site we really don't like removing content. While this might have answered your question, the objective here is to build up a resource with useful information for future users. So even if your question is now answered, this answer (and your question) should remain since they might help the next user with the same issue. That's precisely why the system doesn't let you delete your question if it's been answered. So instead of asking Kusalananda to delete, please take a moment and accept this answer instead.

            – terdon
            6 hours ago














          3












          3








          3







          It increments the value of the variable count by one.





          The line reads



          count=$(($count+1))


          This is an assignment to the variable count. The value that is assigned is an arithmetic expansion, $(( ... )). The arithmetic expression inside $(( ... )) will be evaluated and the whole arithmetic expansion will be replaced by the resulting value, as a string of digits.



          The arithmetic expression is $count + 1. This evaluates to the value of the variable count, plus one.



          The $ on the variable name is not needed here as it's an arithmetic context. The line could therefore be written as



          count=$(( count + 1 ))




          The effect of this counting in the code is that after the loop, the variable count will hold the number of lines read from the file ./$bn/timestamps_$in.txt.



          The script also stores the count of lines in the variable scenes before the loop, so the echo in the loop will show SCENE START: X/Y with X running from 0 to however many lines there are in the file, minus one (since the increment of count happens at the end of the loop), and where Y is the total number of lines in the file.





          I'm also noticing that you have random non-ASCII characters in the code, such as in 𝖿𝖿mpe𝗀 (instead of ffmpeg; both f and g non-ASCII), and in -nostⅾ𝚒n (instead of -nostdin; i and n non-ASCII). These would likely prevent your script from running correctly.






          share|improve this answer















          It increments the value of the variable count by one.





          The line reads



          count=$(($count+1))


          This is an assignment to the variable count. The value that is assigned is an arithmetic expansion, $(( ... )). The arithmetic expression inside $(( ... )) will be evaluated and the whole arithmetic expansion will be replaced by the resulting value, as a string of digits.



          The arithmetic expression is $count + 1. This evaluates to the value of the variable count, plus one.



          The $ on the variable name is not needed here as it's an arithmetic context. The line could therefore be written as



          count=$(( count + 1 ))




          The effect of this counting in the code is that after the loop, the variable count will hold the number of lines read from the file ./$bn/timestamps_$in.txt.



          The script also stores the count of lines in the variable scenes before the loop, so the echo in the loop will show SCENE START: X/Y with X running from 0 to however many lines there are in the file, minus one (since the increment of count happens at the end of the loop), and where Y is the total number of lines in the file.





          I'm also noticing that you have random non-ASCII characters in the code, such as in 𝖿𝖿mpe𝗀 (instead of ffmpeg; both f and g non-ASCII), and in -nostⅾ𝚒n (instead of -nostdin; i and n non-ASCII). These would likely prevent your script from running correctly.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 10 hours ago

























          answered 11 hours ago









          KusalanandaKusalananda

          147k18278463




          147k18278463








          • 2





            @AnonymousUser no, sorry, but on this site we really don't like removing content. While this might have answered your question, the objective here is to build up a resource with useful information for future users. So even if your question is now answered, this answer (and your question) should remain since they might help the next user with the same issue. That's precisely why the system doesn't let you delete your question if it's been answered. So instead of asking Kusalananda to delete, please take a moment and accept this answer instead.

            – terdon
            6 hours ago














          • 2





            @AnonymousUser no, sorry, but on this site we really don't like removing content. While this might have answered your question, the objective here is to build up a resource with useful information for future users. So even if your question is now answered, this answer (and your question) should remain since they might help the next user with the same issue. That's precisely why the system doesn't let you delete your question if it's been answered. So instead of asking Kusalananda to delete, please take a moment and accept this answer instead.

            – terdon
            6 hours ago








          2




          2





          @AnonymousUser no, sorry, but on this site we really don't like removing content. While this might have answered your question, the objective here is to build up a resource with useful information for future users. So even if your question is now answered, this answer (and your question) should remain since they might help the next user with the same issue. That's precisely why the system doesn't let you delete your question if it's been answered. So instead of asking Kusalananda to delete, please take a moment and accept this answer instead.

          – terdon
          6 hours ago





          @AnonymousUser no, sorry, but on this site we really don't like removing content. While this might have answered your question, the objective here is to build up a resource with useful information for future users. So even if your question is now answered, this answer (and your question) should remain since they might help the next user with the same issue. That's precisely why the system doesn't let you delete your question if it's been answered. So instead of asking Kusalananda to delete, please take a moment and accept this answer instead.

          – terdon
          6 hours ago


















          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%2f519953%2fwhat-does-count1-do-in-this-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

          Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

          The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

          How big is the pipe buffer?Turn off buffering in pipeIn what order do piped commands run?When would you use...