像Windows的dos2unix一样吗? [英] Anything like dos2unix for Windows?

查看:606
本文介绍了像Windows的dos2unix一样吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在要在其上运行dos2unix的Windows上创建了一些Shell脚本.

I have some shell scripts created on windows I want to run dos2unix on them.

但是我已经了解到dos2unix Linux 环境中可以工作,因此,有没有一种方法可以在Windows中工作时将文件转换为UNIX格式?

But as I have read that dos2unix works in Linux environment so, is there a way that I can convert my files to UNIX format while working in Windows?

我已经安装了CYGWIN,但是我遇到了一些问题

I have already installed CYGWIN but I am facing some issues as

Administrator@SGH735082N ~
$ pwd
/home/Administrator

Administrator@SGH735082N ~
$ cd C:\CVS Code

Administrator@SGH735082N /cygdrive/c/CVS
$ dos2Unix BLPDB000
BLPDB000:
dos2Unix processing BLPDB000: No such file or directory

Administrator@SGH735082N /cygdrive/c/CVS
$ dos2Unix -h
dos2Unix: bad argument -h: unknown option

Administrator@SGH735082N /cygdrive/c/CVS
$ dos2Unix --help
dos2Unix version 0.1.3
  converts the line endings of text files from
  DOS style (0x0d 0x0a) to UNIX style (0x0a)

Usage: dos2Unix [OPTION...] [input file list...]

Main options (not all may apply)
  -A, --auto     Output format will be the opposite of the autodetected source
                 format
  -D, --u2d      Output will be in DOS format
  --unix2dos     Output will be in DOS format
  -U, --d2u      Output will be in UNIX format
  --dos2unix     Output will be in UNIX format
  --force        Ignore binary file detection
  --safe         Do not modify binary files

Help options
  -?, --help     Show this help message
  --usage        Display brief usage message
  --version      Display version information
  --license      Display licensing information

Other arguments
  [input file list...]       for each file listed, convert in place.
                             If none specified, then use stdin/stdout

Administrator@SGH735082N /cygdrive/c/CVS
$

Administrator@SGH735082N /cygdrive/c/CVS
$ dos2Unix  -oBLPDB000
dos2Unix: bad argument -oBLPDB000: unknown option

Administrator@SGH735082N /cygdrive/c/CVS
$ dos2Unix -k BLPDB000
dos2Unix: bad argument -k: unknown option

Administrator@SGH735082N /cygdrive/c/CVS
$ dos2Unix BLPDB000.txt
BLPDB000.txt:
dos2Unix processing BLPDB000.txt: No such file or directory

Administrator@SGH735082N /cygdrive/c/CVS
$ pwd
/cygdrive/c/CVS

推荐答案

您可以使用 Notepad ++ .

递归转换目录的说明如下:

The instructions to convert a directory recursively are as follows:

  1. 菜单:搜索->在文件中查找...
  2. 目录=要递归转换为Unix格式的目录.例如C:\ MyDir
  3. 找到什么= \ r \ n
  4. 替换为= \ n
  5. 搜索模式=扩展
  6. 按替换文件"

这篇关于像Windows的dos2unix一样吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆