From: Philipp Klaus Date: Tue, 2 Sep 2014 14:11:48 +0000 (+0200) Subject: more structure for the code X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=2999906a9374003220c02fdb89159e8fb4e7d1ea;p=mvd_soft.git more structure for the code --- diff --git a/s-curves/scurve.sh b/s-curves/scurve.sh index c48f6b3..0607c72 100755 --- a/s-curves/scurve.sh +++ b/s-curves/scurve.sh @@ -1,15 +1,17 @@ #!/bin/bash +## Uncomment the following line to debug this script: #set -x -echo -echo " "Usage: ./scurve_new2.sh [ELab/Vacuum] [Number of Runs] [Step Size] -echo +### ------------ Interpret the command line arguments ------------ -if [ -z "$1" ] # check if second parameter is empty +usage () { echo -e "\nUsage: ./scurve_new2.sh [ELab/Vacuum] [Number of Runs] [Step Size]\n"; } + +if [ -z "$1" ] # check if first parameter is empty then + usage echo Error: Specify the system! Use Vacuum or ELab as first parameter. - exit -1; + exit -1 fi if [ $1 == 'ELab' ] @@ -58,11 +60,15 @@ else fi +### ------------ setting up the sensor ------------ # trbcmd w $trbaddr 0x8002 0xaaa0aaa0 # set sensor ID for sensor 0 # trbcmd w $trbaddr 0x8402 0xbbb0bbb0 # set sensor ID for sensor 1 trbcmd w $trbaddr 0x8006 0x1 # set testmode + +### ------------ start data taking ------------ + echo Bank A for i in `seq 0 $stepsize 255` do