Skip to content

Instantly share code, notes, and snippets.

@wixb50
Last active January 24, 2017 12:20
Show Gist options
  • Save wixb50/628ee4fb1c6393888b72fc68a3f0730e to your computer and use it in GitHub Desktop.
Save wixb50/628ee4fb1c6393888b72fc68a3f0730e to your computer and use it in GitHub Desktop.
bash使用tips
  • 为所有指定文件加Header
header='/*\n *  Copyright (c) 2015 by MyCompany, Inc.\n *  All rights reserved.\n */\n'
find ~/my-proj/*.sh -exec sed -i "1s|^|$header|" {} \;
  • linux运行windows的bash文件'\r'问题
sed -i 's/\r$//' filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment