Windows edit of bash file fix
- Ed_P
- Contributor
- Posts: 8373
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Windows edit of bash file fix
If a .sh file is edited in Windows it becomes non-executable in Linux due to a carriage return at the end of lines. Bogomips had a command that fixed the problem, does anyone remember it or have a link to his posting?
Ed
- Ed_P
- Contributor
- Posts: 8373
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Windows edit of bash file fix
Thanks babam I will check it out.
I thought Bogomips thing was a bash command with grep and sed functions.
I thought Bogomips thing was a bash command with grep and sed functions.
Ed
-
- Shogun
- Posts: 238
- Joined: 12 Jun 2021, 21:59
- Distribution: Xfce 4.12 - 5.rc3 - x86_64
- Location: France
Windows edit of bash file fix
I see this as "Alternatives to dos2unix conversion" :
Unix2dos
or
or
or
Unix2dos
Code: Select all
$ tr -d '\r' < file > file2
Code: Select all
$ perl -i -p -e 's/\r//g' file
Code: Select all
$ sed -i -e 's/\r//g' file
Code: Select all
$ col -b < InFile > OutFile
- Ed_P
- Contributor
- Posts: 8373
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Windows edit of bash file fix
Thanks Rapha_.
I getmoded dos2unix and I found Bogomips post: Re: [INFO & SCRIPT] Slackware Mirror Settings for USM (Post by Bogomips #56484) which is similar to your tr one. I'll play around with the various options and see which one is the easiest for me to use.
Thanks guys.
I getmoded dos2unix and I found Bogomips post: Re: [INFO & SCRIPT] Slackware Mirror Settings for USM (Post by Bogomips #56484) which is similar to your tr one. I'll play around with the various options and see which one is the easiest for me to use.
Thanks guys.
Ed