Skip to content

Instantly share code, notes, and snippets.

@matthewcosgrove
Last active November 13, 2020 14:20
Show Gist options
  • Select an option

  • Save matthewcosgrove/69327389c6d5bd9f222ff2d9d68cc228 to your computer and use it in GitHub Desktop.

Select an option

Save matthewcosgrove/69327389c6d5bd9f222ff2d9d68cc228 to your computer and use it in GitHub Desktop.
# Some useful commands for reference
# https://unix.stackexchange.com/a/202326
# $ type local
# local is a shell builtin
# Bash shell builtins are documented inside man bash and their documentation can be also invoked with help
help type
help local
# $ type -a echo
# echo is a shell builtin
# echo is /usr/bin/echo
# echo is /bin/echo
find /home/ubuntu/poc-deployment-pipeline/ \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i 's/repo-ci/concourse/g'
# https://stackoverflow.com/a/16957078
grep -rnw '/path/to/somewhere/' -e 'pattern'
# check affected files in a git repo
git grep -I --files-with-matches --perl-regexp '\r' HEAD
# https://stackoverflow.com/questions/14219092/bash-script-and-bin-bashm-bad-interpreter-no-such-file-or-directory
# Specifically https://stackoverflow.com/a/29747593
sed -i -e 's/\r$//' scriptname.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment