Last active
November 10, 2021 11:57
-
-
Save finnolec/a3a1a107358cd66dc62641035c68f663 to your computer and use it in GitHub Desktop.
Updates picongpu standard profiles in a profile directory in home directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Author: Finn-Ole Carstens | |
| # | |
| # Run this script to update your PIConGPU profiles. | |
| # Do not run this script if you have personal code in your profiles in the $HOME/profiles directory that is not in the not in the picongpu src directory. | |
| FIND_EMAIL="[email protected]" | |
| REPLACE_EMAIL="[email protected]" | |
| SRC_DIR="$HOME/src/picongpu" | |
| TARGET_DIR="$HOME/profiles" | |
| SYSTEM="hemera-hzdr" #or taurus-tud | |
| if [ ! -d "$SRC_DIR" ]; then | |
| echo "src doesn't exist" | |
| echo $SRC_DIR | |
| exit | |
| fi | |
| for file in $SRC_DIR/etc/picongpu/$SYSTEM/*.profile.example; do | |
| target=$(echo $file | rev | cut -d '/' -f1 | rev) | |
| target=$(echo $target | cut -d '.' -f -2) | |
| target="$TARGET_DIR/$target" | |
| cp -v $file $target | |
| sed -i "s/${FIND_EMAIL}/${REPLACE_EMAIL}/g" $target | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment