X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fopensim%2Flist_sims.sh;fp=scripts%2Fopensim%2Flist_sims.sh;h=d78ab3fc44273f09d390a117ba371d3838bf7619;hb=7b39f7e279005c8466ef508220a532ce2aa4abf8;hp=f2b768fc206e94c96ceaafb9587bca569db1fe0f;hpb=3fbd372b35b15a19fb171d5ae34294ff7b1e6485;p=feisty_meow.git diff --git a/scripts/opensim/list_sims.sh b/scripts/opensim/list_sims.sh index f2b768fc..d78ab3fc 100644 --- a/scripts/opensim/list_sims.sh +++ b/scripts/opensim/list_sims.sh @@ -12,14 +12,14 @@ numbers=(Port hold) locats=('Grid Coords' hold) # run through and get the data first... -for region_ini in $HOME/opensim/bin/Regions/*; do - name="$(grep "\[.*\]" <"$region_ini" | tr -d \[\] | sed -e 's/[\r\n]//g' )" +for region_ini in $HOME/opensim/bin/Regions/*.ini; do + name="$(grep "\[.*\]" <"$region_ini" | head -n 1 | tr -d \[\] | sed -e 's/[\r\n]//g' )" if [ ${#name} -gt $max_name ]; then max_name=${#name}; fi names[${#names[*]}]=$name - port="$(grep "InternalPort" <"$region_ini" | sed -e 's/InternalPort *= *//' -e 's/[\r\n]//g' )" + port="$(grep "InternalPort" <"$region_ini" | head -n 1 | sed -e 's/InternalPort *= *//' -e 's/[\r\n]//g' )" if [ ${#port} -gt $max_port ]; then max_port=${#port}; fi numbers[${#numbers[*]}]=$port - location="$(grep "Location" <"$region_ini" | sed -e 's/Location *= *//' -e 's/[\r\n]//g' )" + location="$(grep "Location" <"$region_ini" | head -n 1 | sed -e 's/Location *= *//' -e 's/[\r\n]//g' )" if [ ${#location} -gt $max_location ]; then max_location=${#location}; fi locats[${#locats[*]}]=$location done @@ -40,7 +40,7 @@ locats[1]=$dash # now print the data in a pleasant fashion... indy=0 -for region_ini in header line $HOME/opensim/bin/Regions/*; do +for region_ini in header line $HOME/opensim/bin/Regions/*.ini; do # indy is a zero-based array index. name=${names[$indy]} port=${numbers[$indy]}