Pastebin Bash Scripts

Before I finish re-inventing the wheel with my own script management site, I am currently using Pastebin which has an issue for Linux users. It outputs scripts with Windows line endings. This means that wget commands will append

characters to the end of your URLs, causing them to fail. This is not mitigatd by wrapping your URLs in quotes for some reason either.


Running the command below will fail even though it appears to be a perfectly valid script if you go to the source

wget -O - | sudo bash


Add the following section to your commands when you fetch content from pastebin:

tr -d '\r'

So a complete command would look like so:

wget -O - | tr -d '\r' | sudo bash

No comments:

Post a Comment