Month: June 2017

  • Walk the line…endings

    Have a file where you want to add a comma to the end of each line? $ sed ‘s/$/,/’ ip_addresses.txt | head -n2 This should work…but, wait, it didn’t. Instead, it replaced the first character of each line with a comma. Why? ,6.127.0.0/17 ,7.238.80.0/21 Aha, it is because the file is dos encoded. See the […]