I'm making a bash script, and I have a problem when I need to transfer lines to a .sh
to another .sh
#!/bin/bash
while read -r line; do
if [[ $line != "#" ]]; then
echo -e "$line" >>save.sh
fi
done
With this code I'm transfering lines but in my save.sh I don't have tab or spaces at all
#!/bin/bash
if [ $# == 0 ]; then
echo "Error: not enough arguments"
exit 84
fi
I was wondering if anyone had any idea where it might come from.
I changed the echo to echo -e but nothing does, when i'm moving my lines to another files, the indentations is deleted.