Skip to content

Instantly share code, notes, and snippets.

@incfly
Last active May 6, 2021 00:32
Show Gist options
  • Save incfly/5a8918ebff96b123d95960d99f4b47f4 to your computer and use it in GitHub Desktop.
Save incfly/5a8918ebff96b123d95960d99f4b47f4 to your computer and use it in GitHub Desktop.
# https://unix.stackexchange.com/questions/25122/how-to-use-regex-with-awk-for-string-replacement
# second answer.
awk 'match($0, /VIR.*/) { $0 = "HERE=\"$(cd \"...\")" } 1 { print } ' ./input.sh
function rerun() {
# Put all the commands needed to perform a compile, upload, and job submission here.
# e.g copy to remote machine
scp python-main.py master:~/
# start the hive run
hive start abc
# You can also pass some parameters for the function.
# E.G this way, `rerun job1 job2` will print out "job1 job2" line below.
echo $1 $2
echo "done"
}
VIRTUAL_ENV="your/path/abc/"
HERE="$(cd "$(dirname $(BASH_SOURCE[0]) && pwd))"
abc
@incfly
Copy link
Author

incfly commented Apr 23, 2021

Usage

source ./developer-flow.sh

for the rest of the bash operation, rerun, instead of a series of commands.

rerun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment