A simple bash script to get an echo command from a text file, in order to recreate it from the command.
Doesn't work on binary files.
wget https://raw.githubusercontent.com/Sad-theFaceless/file2echo/main/file2echo.sh && chmod +x file2echo.sh
- Right click on this link, and Save link as...
- Once the file is downloaded, right click on it then Run with PowerShell
The first time you launch the PowerShell script, it will download all the prerequisite files in a temporary directory.
It will then open a new prompt window that allows you to run the actual Bash script. (see Usage)
./file2echo.sh $FILE
./file2echo.sh $FILE | bash > $NEW_FILE
Taking a getIP.sh
file with the following content:
#!/bin/sh
dig +short myip.opendns.com @resolver1.opendns.com A
Inside the terminal:
./file2echo.sh getIP.sh
Output:
echo -ne '#!/bin/sh\n\ndig +short myip.opendns.com @resolver1.opendns.com A\n'