nemoinp [parameter=value] ...
It may come in handy to set an array in a shell variable or to initialize
tables, e.g. nemoinp 1:10:2 will then result in 1 3 5 7 9. Although such
implied loops are a common feature of scripting environments, there are
subtle differences:
nemoinp 1:10:2 matlab 1:2:10 seq 1 2 10 numpy.arange 1,10,2 last element (10) is never used IDL findgen(5)*2+1 -or- indgen(5)*2+1
nemoinp 4.2+3.1 simple math
nemoinp ’sqrt(2)’ math functions
nemoinp pi+3 some support for funny numbers
nemoinp 2:20:4 from 2 to 20 in steps of 4 (NEMO command)
seq 2 4 20 from 2 to 20 in steps of 4 (UNIX command)
set n=20 a (t)C-shell variable
n=20 a bash/zsh variable
nemoinp 2:${n}:4 as before, now using a shell variable
nemoinp 2::4 repeat the value 4 times
nemoinp ’10**[0:3:1]’ log spaced values 1 10 100 1000
nemoinp ’iflt(1,2,3,4)’ print 3, not 4, because 1 is less than 2
nemoinp 30:30:15 dms=t convert hexasegimal 30:30:15 into decimal
30.5043
nemoinp c,G,h,p,m a few good constants
nemoinp ’p*pi/(3600*180)’ 1 AU in m
things that it cannot do are sometimes captured with little known unix
commands. Here are some examples: echo "ibase=2; obase=8; 101101" | bc # convert binary to octal echo 1.2/4.5 | bc -l # floating point math z=$((x + y)) # sum integers in bash
18-apr-89 V1.0 created PJT 20-jun-89 V1.0a small changed - doc updated PJT 5-jul-89 V1.1 added nmax parameter PJT 18-may-92 documentation 16-jun-97 V1.6 %d forces integer math PJT 28-aug-00 V1.7 documented tab= and seed= PJT 31-may-01 V1.8 added atof= PJT 4-mar-03 V1.9 added dms= PJT