echo ""
echo ""
echo ==== RUNNING NEXCADE UNIX MODE =====
echo ""
if test -s $1.ncol
then
./clean_all
echo $1 >network.name
cp $1.ncol DATA.ncol
`cat Rpath` --no-restore --no-save --no-readline --slave < runR_main.R >>R.out
sed 1d DATA.nodes | sort -k2,2 >DATA.nodes.select
sed '1d' DATA.nodes | cut -d' ' -f2- >itmp7
mv itmp7 DATA.nodes
grep '"' DATA.degree | awk '{print $3, $2}' | sed 's/"//g' >ideg
mv ideg DATA.degree
awk '{print $1}' DATA.degree > DATA_DEGREEMinMax_ALL.cascade
tac DATA_DEGREEMinMax_ALL.cascade >DATA_DEGREEMaxMin_ALL.cascade
cat DATA.nodes | awk 'BEGIN{srand();}{print rand()"\t"$0}' | sort -k1 -n | cut -f2- | sed 's/ //g' >DATA_DEGREERandom_ALL.cascade
sed 's/^/.\/run_check_extinction "/' DATA.nodes | sed 's/$/"/' >get_total_extinction_ALL
chmod a+x get_total_extinction_ALL
echo start >start.tmp
grep SIZE DATA.details | cut -d: -f2 >total_sp
grep EDGES DATA.details | cut -d: -f2 >total_int
sed 's/Size/'"`cat total_sp`"'/' line1 | sed 's/Int/'"`cat total_int`"'/' >outline1
echo "DEGREE                  :" > attr.node
echo "BETWEENNESS CENTRALITY  :" >> attr.node
echo "CLOSENESS CENTRALITY    :" >> attr.node
echo "EIGENVECTOR CENTRALITY  :" >> attr.node
echo ============SCAN COMPLETE!==========
else
echo THERE IS NO FILE NAMED $1.ncol
echo PLEASE RECHECK YOUR INPUT
echo ====================================
fi
echo ""
echo ""
echo ""

