You should be able to get dos2unix
from your package manager on Linux.
If you are using a Debian-based distro, you should be able to do sudo apt-get install dos2unix
.
If you are using a RH-like distro, you should be able to do sudo yum install dos2unix
.
Once it is installed, you can just give the target file as an argument’
dos2unix test.pl
Also, note that this may not be the only problem you might run into while trying to move a script to Linux from Windows.
For example, if you are invoking any external tools in your script, those tools will probably have different names or not exist at all on the other platform.
Also, if you are using any relative file paths with path separators, the separator is different on Linux (which uses /
) than Windows (which uses \
).
Related Posts:
- Chmod 777 to a folder and all contents [duplicate]
- Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running?
- Amazon Linux: apt-get: command not found
- How do I find all files containing specific text on Linux?
- “Couldn’t find a file descriptor referring to the console” on Ubuntu bash on Windows
- Where can I find php.ini?
- gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now
- How can I recursively find all files in current and subfolders based on wildcard matching?
- How to install grub after installing Windows 10
- Linux: ‘Username’ is not in the sudoers file. This incident will be reported
- “E: Unable to locate package python-pip” on Ubuntu 18.04 [duplicate]
- -bash: syntax error near unexpected token `newline’ for display command
- SSH using python script
- How can I exclude directories from grep -R?
- How to exclude a directory in find . command
- Changing the resolution of a VNC session in linux
- mysql_config not found when installing mysqldb python interface
- Linux error while loading shared libraries: cannot open shared object file: No such file or directory
- Shell command to tar directory excluding certain files/folders
- QEMU: /bin/sh: can’t access tty; job control turned off
- Explaining the ‘find -mtime’ command
- Meaning of exit status 1 returned by linux command
- Creating a new directory in C
- What is difference between arm64 and armhf?
- Extract file basename without path and extension in bash
- How to change permissions for a folder and its subfolders/files in one step
- mv: cannot stat error : No such file or directory error
- mysql_config not found when installing mysqldb python interface
- Linux error while loading shared libraries: cannot open shared object file: No such file or directory
- Pseudo-terminal will not be allocated because stdin is not a terminal
- linux command to get size of files and directories present in a particular folder?
- screen Cannot open your terminal ‘/dev/pts/0’ – please check
- ./configure : /bin/sh^M : bad interpreter
- TCP congestion control version: HTCP module vs highspeed module in linux kernel
- How to use regex with find command?
- What is the difference between /etc/rc.local and ~/.bashrc?
- Snort Message – WARNING: No preprocessors configured for policy 0
- How to count lines in a document?
- What does `set -x` do?
- Compile the Fortran program in Windows using gfortran
- How can I set the ‘backend’ in matplotlib in Python?
- Yum fails with – There are no enabled repos.
- Unable to establish SSL connection upon wget on Ubuntu 14.04 LTS
- Using ls to list directories and their total sizes
- Getting stty: standard input: Inappropriate ioctl for device when using scp through an ssh tunnel
- configure: error: cannot run C compiled programs
- tar: add all files and directories in current directory INCLUDING .svn and so on
- What does set -e mean in a bash script?
- How to make rpm auto install dependencies
- How do I install chkconfig on Ubuntu?
- “find: paths must precede expression:” How do I specify a recursive search that also finds files in the current directory?
- Apache server keeps crashing, “caught SIGTERM, shutting down”
- List all mounts in Linux
- How to use sed to extract substring
- Wait for user input in C?
- Difference between exec, execvp, execl, execv?
- Restarting cron after changing crontab file?
- tar: Error is not recoverable: exiting now
- cd into directory without having permission
- python-dev installation error: ImportError: No module named apt_pkg
- How to enable Bash in Windows 10 developer preview?
- Android – Command not found
- EC2 ssh Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
- What does ‘bash -c’ do?
- How do I know the script file name in a Bash script?
- WordPress can’t find temporary folder, but folder it’s looking at has correct permissions
- WordPress cloning issue
- Anyone else experiencing high rates of Linux server crashes during a leap second day?
- What permissions should my website files/folders have on a Linux webserver?
- Can I automatically add a new host to known_hosts?
- Can I nohup/screen an already-started process?
- How can I run Debian stable but install some packages from testing?
- Environment variables of a running process on Unix?
- In my /etc/hosts/ file on Linux/OSX, how do I do a wildcard subdomain?
- Shell command to monitor changes in a file
- Meaning of the buffers/cache line in the output of free
- How to cd into a directory with this name “-2” (starting with the hyphen)?
- how to disable SSH login with password for some users?
- Difference in sites-available vs sites-enabled vs conf.d directories (Nginx)?
- Is it possible to detach a process from its terminal? (Or, “I should have used screen!”) [duplicate]
- Disk full, du tells different. How to further investigate?
- Filename length limits on linux?
- best way to clear all iptables rules
- How can I port forward with iptables?
- Why do we use a OS Base Image with Docker if containers have no Guest OS?
- How can I rename a Unix user?
- How to re-order windows, change the scroll shortcut, and modify the status bar contents in GNU Screen?
- How to make Windows 7 USB flash install media from Linux?
- How to install/change locale on Debian?
- What limits the maximum number of connections on a Linux server?
- How to prevent a user from login in, but allow “su – user” in Linux?
- I have a keypair. How do I determine the key length?
- How to do the port forwarding from one ip to another ip in same network?
- Why drop caches in Linux?
- Linux – Is there a way to prevent/protect a file from being deleted even by root?
- swap partition vs file for performance?
- Best way to disable swap in Linux
- How to remove invalid characters from filenames?
- How can I zip/compress a symlink?
- How to find the physical volume(s) that hold a logical volume in LVM