Created
June 30, 2023 10:57
-
-
Save atemate/03a520840182848b9e88e0da395607e9 to your computer and use it in GitHub Desktop.
Replace first entry in a file (with sed)
This file contains 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
echo "tag=$tag" | |
echo "FILE_PATH=$FILE_PATH" | |
export LINE_MARK="tag:" | |
sed -i'' -e "0,/$LINE_MARK .*/s//$LINE_MARK $tag/" "$FILE_PATH" # replace first entry |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment