#!/bin/sh
for i in $( seq 1 $1 ); do
echo $(( i*i*i ))
done
#!/bin/sh
odm=$( echo "sqrt($1)" | bc )
for i in $( seq 1 $odm ); do
if [ $(( i % $2 )) -ne 0 ]; then
echo $i
fi
done
#!/bin/sh
pi="3.1415926"
obvod=$( echo "sqrt(2*$pi*$1)" | bc -l )
obsah=$( echo "sqrt($pi*$1*$1)" | bc -l )
echo "Obvod: $obvod"
echo "Obsah: $obsah"
#!/bin/bash
x=$1
y=$2
while [ $y -gt 0 ]; do
if [ $x -ge $y ]; then
x=$(( x-y ))
else
z=$x; x=$y; y=$z
fi
done
echo $x
#!/bin/sh
read x y
echo $(( x+y ))
#!/bin/bash
while read x; do
sum=$(( sum + x ))
done
echo $sum
#!/bin/bash
echo $@ | tr " " "\n" | sort -n | tr "\n" " "