Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Determining a version number for a software project is based on its relative change / functionality / development stage / revision. Consequent increments to the version and revision numbering is ideally a process that should be done by a human. However, not to second-guess your motivation for writing this script, here is my suggestion.</p> <p>Include some logic in your script that will do exactly what you describe in your requirement </p> <p><em>"...if the last section after dot has two digits, inc until 99; if only 1, then inc until 9 ... "</em></p> <p>Assuming the third position is the development stage number <code>$dNum</code> and the fourth (last) position is the revision number <code>$rNum</code>:</p> <pre><code>if [ $(expr length $rNum) = "2" ] ; then if [ $rNum -lt 99 ]; then rNum=$(($rNum + 1)) else rNum=0 dNum=$(($dNum + 1)) #some additional logic for $dNum &gt; 9 also needed fi elif [ $(expr length $dNum) = "1" ] ; then ... ... fi </code></pre> <p>Perhaps a function will allow the most succinct way of handling all positions (majNum.minNum.dNum.rNum). </p> <p>You will have to separate the project name and version number components of your filename in your script and then construct the version number with all its positions, and finally reconstruct the filename with something like</p> <pre><code>new_version="$majNum.minNum.$dNum.$rNum" new_version_file="$old_file.$new_version" </code></pre> <p>Hope that helps and check <a href="https://stackoverflow.com/questions/1146359/how-to-define-the-version-number-of-a-software">this SO discussion</a> as well as <a href="http://en.wikipedia.org/wiki/Software_versioning" rel="nofollow noreferrer">this wikipedia entry</a> if you want to know more about versioning conventions.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload