Skip to content

Instantly share code, notes, and snippets.

@TyeolRik
Created October 5, 2023 02:00
Show Gist options
  • Save TyeolRik/531e1fb9eaed88ea2a59a087b00c0dca to your computer and use it in GitHub Desktop.
Save TyeolRik/531e1fb9eaed88ea2a59a087b00c0dca to your computer and use it in GitHub Desktop.
Replace whole line which matches.
#!/bin/bash
version=$(git rev-parse HEAD | cut -c1-8)
version="0.1.7-nightly-$version"
sed -i "/EXTCTRL_VERSION = \"/c\ EXTCTRL_VERSION = \"$version\";" ./main.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment