bash

Table of Contents

1 Bash script building blocks

1.1 Math

1.1.1 Script to count 0-360 with floating points at intervals of 3.64

1.1.2 Same as above except the intervals can be given as a variable

1.1.3 Same as above except the number of files being process is used to find intervals

1.1.4 Script to add/subtract a variable to 4 different integers up to a predefined point

1.1.5 Feed a sequence of numbers to calculations

1.1.6 command to remove floating points. needed because if statements don't except float points as variables.

echo 1.1111 | awk '{printf "%.0f",$1}'

1.1.7 script to make sure a number becomes a divisor of another

1.2 Counting loops

1.2.1 Counting up to a certain number

1.2.2 Loop counting up to a certain number repeatedly

1.2.3 Loop counting up to a certain number repeatedly, stopping at a predefined point

1.2.4 Counting up to a certain number and then back down

1.2.5 Two loops counting from A to the numbers B and C and then back down, etc…

1.3 File infos

1.3.1 Take a folder and calculate how many files there are within

1.3.2 Take any number of folders and calculate the maximum number of files in any one folder

1.3.3 Same as above, but also calling the files in each folder and looping in the count for the smaller folders.

1.3.4 check the size of the file 001.png

Date: 2009-03-28 21:54:17 CET

HTML generated by org-mode 6.24b in emacs 22