[colug-432] Script basic
Angelo McComis
angelo at mccomis.com
Wed May 13 14:28:08 EDT 2015
Depending on which distro you have and what packages are installed, there's
a handy dandy little pair of utilities for working with these differences
between "dos" and "unix" machines. Not surprisingly, the pair of utilities
are called "dos2unix" and "unix2dos" - and it deals with the ^M you see
when you bring a dos-edited package over to Linux/UNIX, and similarly, it
puts the ^L in with the ^M to make it not all run together as one long line
when you bring a file written on UNIX/Linux over to Dos.
Usage is pretty much as you'd expect:
dos2unix original.txt > outputfile
and so forth.
On Wed, May 13, 2015 at 2:18 PM, Scott Merrill <skippy at skippy.net> wrote:
>
> > On May 13, 2015, at 2:12 PM, Steve VanSlyck <s.vanslyck at postpro.net>
> wrote:
> >
> > Umpf.
> >
> > Yes, I have seen it before, now you mention it. Seems my old windows
> machines always started with PATH=.;... Or at least I seem to remember it
> that way. Regardless, I always *assumed* the computer always looked in the
> current directory first.
> >
> > Anyway, as you saw in previous email i am now getting this
> > [root at vslaw2 ~]# ./server_setup.sh
> > -bash: ./server_setup.sh: /bin/bash^M: bad interpreter: No such file or
> directory
> > error.
> >
> > No idea what the ^M means. I don't see anything when looking at the file
> in nano and confirmed it with VI/VIM just to be sure, with same result
> >
>
> You’re running into one of the frustrating differences between Windows and
> UNIX (and Mac!) systems.
>
> http://www.cs.toronto.edu/~krueger/csc209h/tut/line-endings.html
>
> https://en.wikipedia.org/wiki/Newline
>
> If you’re editing files on Windows and then transferring them over to
> Linux, you’ll likely keep having this problem. There are several solutions.
>
> You can use a text editor that understands different line endings. The
> default Windows Notepad application *does not* understand anything other
> than Windows line endings.
>
> You can use a tool called `dos2unix` on your Linux systems to convert
> Windows line endings to UNIX line endings.
>
> Cheers,
> Scott
>
>
>
> _______________________________________________
> colug-432 mailing list
> colug-432 at colug.net
> http://lists.colug.net/mailman/listinfo/colug-432
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.colug.net/pipermail/colug-432/attachments/20150513/506c6177/attachment.html
More information about the colug-432
mailing list