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
| cd() { | |
| builtin cd "$@" || return | |
| ( | |
| set +m; | |
| if [ -d '.git' ]; then | |
| o=$(git fetch origin 2>&1) && | |
| [ -n "$o" ] && printf '\e[1A\e[2K\e[1A\e[2K' && | |
| echo -e "$o" && | |
| echo -e "\033[01;32m\n@@@@@@@@" && | |
| echo -e "@ There were changes since last time you were here. Please merge\!" && |
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
| myfile=test.txt && | |
| # Identify the starting and ending line of the block you want to replace | |
| replace_this_start=$(grep -n 'STARTLINE_OF_STRING_THAT_NEEDS_REPLACEMENT' \ | |
| ${myfile} | awk -F':' '{ print $1 }') && | |
| replace_this_stop=$(grep -n 'ENDLINE_OF_STRING_THAT_NEEDS_REPLACEMENTt' \ | |
| ${myfile} | awk -F':' '{ print $1 }') && | |
| ( | |
| head -n${replace_this_start} ${myfile} && |