linux - How to use dos2unix? -


I am learning perl programming. I have run a Perl script in the Windows platform but I need to run it like a Linux platform like Ubuntu. My script runs entirely in windows but not in Linux. I'm not familiar with the dos2unix tool. I'm struggling to use this in my Windows 7 and how to convert my winfile to unixfile. Suppose that my perl script is test.pl and coding is inside. How do I work correctly using this dos2unix tool in linux? Also, how should I open the dos2unix tool?

You should be able to get the dos2unix from your package manager on Linux .

If you are using a Debian-based distro, you should be able to do sudo apt-get dos2unix .

If you want to be RH-such as distro, you should be able to sudo yum install dos2unix .

Once installed, you can only give the target file as an argument '

  dos2unix test.pl   

In addition, note that this can not be the only problem, that you can run Linux while trying to move from Windows to Script.

For example, if you are using an external device in your script, then those devices probably have different names or are not present on other platforms.

In addition to this, if you use a relative file path along the path separator, compared to the separator Windows (which uses \ ) code> / ).

Comments

Post a Comment

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -