当前位置: 技术问答>linux和unix
Shell语句求教!shell cygpath -a -m $(TOPDIR)
来源: 互联网 发布时间:2017-02-07
本文导语: shell cygpath -a -m $(TOPDIR) 其中,TOPDIR为当前的pwd 求教,cygpath这个内置变量的参数-a -m是什么意思?整条语句是什么意思啊? 我猜想是设置cygwin的当前路径,具体原因不是很清楚,请高手指点一下 | ...
shell cygpath -a -m $(TOPDIR)
其中,TOPDIR为当前的pwd
求教,cygpath这个内置变量的参数-a -m是什么意思?整条语句是什么意思啊?
我猜想是设置cygwin的当前路径,具体原因不是很清楚,请高手指点一下
其中,TOPDIR为当前的pwd
求教,cygpath这个内置变量的参数-a -m是什么意思?整条语句是什么意思啊?
我猜想是设置cygwin的当前路径,具体原因不是很清楚,请高手指点一下
|
不是设置路径,是输出不同格式路径信息
$ pwd
/cygdrive/d/code/shell
$ cygpath -a $(PWD) -a输出全路径
/cygdrive/d/code/shell
$ cygpath -m $(PWD) -m输出类似WINDOWS路径
D:/code/shell
$ cygpath -a -m $(PWD)
D:/code/shell
详细参考帮助
$ cygpath
Usage: cygpath (-d|-m|-u|-w|-t TYPE) [-f FILE] [OPTION]... NAME...
cygpath [-c HANDLE]
cygpath [-ADHOPSW]
cygpath [-F ID]
Convert Unix and Windows format paths, or output system path information
Output type options:
-d, --dos print DOS (short) form of NAMEs (C:PROGRA~1)
-m, --mixed like --windows, but with regular slashes (C:/WINNT)
-M, --mode report on mode of file (binmode or textmode)
-u, --unix (default) print Unix form of NAMEs (/cygdrive/c/winnt)
-w, --windows print Windows form of NAMEs (C:WINNT)
-t, --type TYPE print TYPE form: 'dos', 'mixed', 'unix', or 'windows'
Path conversion options:
-a, --absolute output absolute path
-l, --long-name print Windows long form of NAMEs (with -w, -m only)
-p, --path NAME is a PATH list (i.e., '/bin:/usr/bin')
-s, --short-name print DOS (short) form of NAMEs (with -w, -m only)
-C, --codepage CP print DOS, Windows, or mixed pathname in Windows
codepage CP. CP can be a numeric codepage identifier,
or one of the reserved words ANSI, OEM, or UTF8.
If this option is missing, cygpath defaults to the
character set defined by the current locale.
System information:
-A, --allusers use `All Users' instead of current user for -D, -O, -P
-D, --desktop output `Desktop' directory and exit
-H, --homeroot output `Profiles' directory (home root) and exit
-O, --mydocs output `My Documents' directory and exit
-P, --smprograms output Start Menu `Programs' directory and exit
-S, --sysdir output system directory and exit
-W, --windir output `Windows' directory and exit
-F, --folder ID output special folder with numeric ID and exit
Try `cygpath --help' for more information.
$ pwd
/cygdrive/d/code/shell
$ cygpath -a $(PWD) -a输出全路径
/cygdrive/d/code/shell
$ cygpath -m $(PWD) -m输出类似WINDOWS路径
D:/code/shell
$ cygpath -a -m $(PWD)
D:/code/shell
详细参考帮助
$ cygpath
Usage: cygpath (-d|-m|-u|-w|-t TYPE) [-f FILE] [OPTION]... NAME...
cygpath [-c HANDLE]
cygpath [-ADHOPSW]
cygpath [-F ID]
Convert Unix and Windows format paths, or output system path information
Output type options:
-d, --dos print DOS (short) form of NAMEs (C:PROGRA~1)
-m, --mixed like --windows, but with regular slashes (C:/WINNT)
-M, --mode report on mode of file (binmode or textmode)
-u, --unix (default) print Unix form of NAMEs (/cygdrive/c/winnt)
-w, --windows print Windows form of NAMEs (C:WINNT)
-t, --type TYPE print TYPE form: 'dos', 'mixed', 'unix', or 'windows'
Path conversion options:
-a, --absolute output absolute path
-l, --long-name print Windows long form of NAMEs (with -w, -m only)
-p, --path NAME is a PATH list (i.e., '/bin:/usr/bin')
-s, --short-name print DOS (short) form of NAMEs (with -w, -m only)
-C, --codepage CP print DOS, Windows, or mixed pathname in Windows
codepage CP. CP can be a numeric codepage identifier,
or one of the reserved words ANSI, OEM, or UTF8.
If this option is missing, cygpath defaults to the
character set defined by the current locale.
System information:
-A, --allusers use `All Users' instead of current user for -D, -O, -P
-D, --desktop output `Desktop' directory and exit
-H, --homeroot output `Profiles' directory (home root) and exit
-O, --mydocs output `My Documents' directory and exit
-P, --smprograms output Start Menu `Programs' directory and exit
-S, --sysdir output system directory and exit
-W, --windir output `Windows' directory and exit
-F, --folder ID output special folder with numeric ID and exit
Try `cygpath --help' for more information.