Skip to content
Snippets Groups Projects
Commit b892cbf7 authored by David Hendriks's avatar David Hendriks
Browse files

refined the script

parent f4a8dd67
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
#####
# Script to execute mcluster to set up inital settings for a cluster.
# Useage: run the script. Change the values of NAME_RUN, MCLUSTER_COMMANDS and TARGET_DIR to your liking. After running this script you can use the output to feed it to nbody6
######
# TODO:
# rename the files
# Check if dir exists.
# Dont change these settings
MCLUSTER_CONFIG_DIR='/vol/ph/astro_code/dhendriks/work_dir/mcluster'
MCLUSTER_EXECUTABLE='/vol/ph/astro_code/dhendriks/mcluster/mcluster'
NAME_RUN='test'
# Change these settings
TARGET_DIR=$MCLUSTER_CONFIG_DIR
NAME_RUN='test'
# Store settings for mcluster in here.
MCLUSTER_COMMANDS="-C0 -o"
# Check if dir is empty: if not: empty it
DIR="test"
if [ "$(ls -A $TARGET_DIR)" ]; then
echo "Take action $TARGET_DIR is not Empty"
echo "Deleting content:"
rm $TARGET_DIR/*
else
echo "$TARGET_DIR is Empty"
fi
# Execute mcluster cmd
$MCLUSTER_EXECUTABLE $MCLUSTER_COMMANDS $MCLUSTER_CONFIG_DIR/$NAME_RUN | tee $MCLUSTER_CONFIG_DIR/$NAME_RUN.summary
# Write command to file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment