Tag Archive

amateur astronomy awk bash b[e] supergiant cartoon conference convert evolved star exoplanet fedora figaro fits fun galaxy iraf large magellanic cloud latex linux lmc machine learning magellanic clouds massive star matplotlib meteor mypaper paper peblo photometry planet pro-am pyraf python red supergiant scisoft skinakas observatory small magellanic cloud smc spectroscopy starlink talk ubuntu university of crete video x-ray yellow hypergiant

Floating point numbers in bash or csh

They just don’t pass through!!

Bash or csh are unable to use floating numbers, as they understand numbers containing decimal point as strings. So, only actions with full numbers can be performed in these shells.

Useful small things for c-shell

> When using if statement in c-shell you have to be careful with the syntax:

if (condition) then

or if you want to add another case then

if (condition) then

Important to remember that after “then” you must continue to a new line.

> “exit” is the one option to work with if statement, since “break” works only with foreach/while

> If you want to assign the output of a command to a variable the \n you have to place this into backticks ` … ` like:
set test = `grep "test text" temp`

While loop in C-shell scripts

When using the while loop in C-shell scripting the usual stucture is:

while (expression)


BUT, you need to add an empty line or a comment after end in order for the loop to work!