![]() |
![]() |
#1 |
"Ed Hall"
Dec 2009
Adirondack Mtns
2×2,707 Posts |
![]()
[rant]
The more Fedora advances, the more useless it is becoming - recall my other issues... Now I find that gedit is producing a "Windows" formatted text, that won't run as a bash script. Do any of the learned linux guys have a quick fix? I'm about to trash Fedora. Maybe it's past time... [/rant] Thanks for any help... Last fiddled with by EdH on 2016-05-11 at 02:55 |
![]() |
![]() |
![]() |
#2 |
"/X\(‘-‘)/X\"
Jan 2013
2×32×52×7 Posts |
![]()
Check the line ending setting. You want "Unix" line termination, not "Windows" or "Mac".
I don't use gedit personally, as I really dislike Gnome, but googling tells me there should be a "Line Ending" setting when you save the file. |
![]() |
![]() |
![]() |
#3 |
Tribal Bullet
Oct 2004
3,559 Posts |
![]()
Your system should also have 'unix2dos' and 'dos2unix' utilities that allow you to retroactively fix the line endings on files you have.
Windows notepad similarly cannot properly display files with unix line endings; I work around as necessary. Incompatibilities between text editors are low on the list of cross-platform problems that I have to deal with. |
![]() |
![]() |
![]() |
#4 |
"Ed Hall"
Dec 2009
Adirondack Mtns
10101001001102 Posts |
![]()
Thank you for the replies. I had looked with no success for the line ending setting. It must be hiding with the un/redo entries I'm suppose to have.
Anyway, the problem is fixed. I unwittingly caused it due to another recent shortfall of Fedora: files no longer allows for the creation of a new document via a right-click. Therefore, I copied/pasted an existing .sh file and edited it. Apparently the c/p transformed the original's line endings for some unknown reason. By starting afresh with a new gedit document, and creating/saving a .sh file with the proper first line, the line endings are correct for the rest of the editing. I was unaware of the two conversion routines. Thanks! I may make use of those. |
![]() |
![]() |
![]() |
#5 |
Aug 2002
3×2,861 Posts |
![]() ![]() |
![]() |
![]() |
![]() |
#6 |
Aug 2002
206078 Posts |
![]()
For fun you can use od to view the actual contents of a file.
Code:
$ cat dos.txt | od -c 0000000 a b c 1 2 3 \r \n 1 2 3 a b c \r \n 0000020 $ cat unix.txt | od -c 0000000 a b c 1 2 3 \n 1 2 3 a b c \n 0000016 http://stackoverflow.com/questions/2...in-bash-script |
![]() |
![]() |
![]() |
#7 |
Aug 2002
858310 Posts |
![]() |
![]() |
![]() |
![]() |
#8 | ||
Apr 2010
22×3×13 Posts |
![]() Quote:
Quote:
Code:
tr -d '\r' <winfile.txt >unixfile.txt Code:
sed -i.bak 's:\r::g' textfile.txt |
||
![]() |
![]() |
![]() |
#9 |
Romulan Interpreter
"name field"
Jun 2011
Thailand
282D16 Posts |
![]()
in windoze, use Programmers' Notepad !
(one of the best, small, and free!) (no, eclipse is not "small") You can select what line endings you want, and write your own scripts, own menu commands, etc, if you like. It also has a nice python extension and lots of syntax schema... |
![]() |
![]() |
![]() |
#10 |
"/X\(‘-‘)/X\"
Jan 2013
2×32×52×7 Posts |
![]()
Notepad.
I remember using Notepad. Once I had to create a web based tutorial on using FrontPage. FrontPage was so awful I wrote the tutorial in Notepad. |
![]() |
![]() |
![]() |
#11 |
"Mark"
Apr 2003
Between here and the
23×307 Posts |
![]() |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Posts that seem less than useless, or something like that | jasong | Forum Feedback | 1054 | 2022-06-20 22:34 |
bash and HTTP? | Dubslow | Information & Answers | 11 | 2011-12-14 21:07 |
Fedora ecm installed, but where? | jasong | GMP-ECM | 8 | 2011-01-03 03:57 |
Useless DC assignment | lycorn | PrimeNet | 16 | 2009-09-08 18:16 |
Fedora | tha | Software | 2 | 2004-01-13 23:12 |