如何检测系统是否为大小写敏感的文件系统

本文详细介绍了如何使用bash命令检查并处理在不同文件系统和路径中存在的问题,包括敏感文件系统检测、路径中空格的检查以及目录创建命令的使用。文章深入探讨了`mkdir-p`、`echo`、`cat`等命令的功能,并提供了相应的参数说明,旨在帮助开发者在遇到不兼容的文件系统或路径问题时进行有效处理。

ifneq ($(HOST_OS),windows)

ifneq ($(HOST_OS)-$(HOST_ARCH),darwin-ppc)

# check for a case sensitive file system

ifneq (a,$(shell mkdir -p $(OUT_DIR) ; \

               echo a > $(OUT_DIR)/casecheck.txt; \

                   echo B > $(OUT_DIR)/CaseCheck.txt; \

               cat $(OUT_DIR)/casecheck.txt))

$(warning************************************************************)

$(warning You are building on a case-insensitivefilesystem.)

$(warning Please move your source tree to acase-sensitive filesystem.)

$(warning************************************************************)

$(error Case-insensitive filesystems not supported)

endif

endif

endif

1.mkdir bash命令的使用

   mkdir -p

USERNAME@USERNAME-desktop:~$ mkdir --help

Usage: mkdir [OPTION]... DIRECTORY...

Create the DIRECTORY(ies), if they do not alreadyexist.

Mandatory arguments to long options are mandatory forshort options too.

  -m,--mode=MODE   set file mode (as inchmod), not a=rwx - umask

  -p, --parents     no error if existing, make parent directoriesas needed

  -v,--verbose     print a message for eachcreated directory

  -Z,--context=CTX  set the SELinux securitycontext of each created

                     directory to CTX

     --help     display this help andexit

     --version  output versioninformation and exit

 

Report mkdir bugs to bug-coreutils@gnu.org

GNU coreutils home page:<http://www.gnu.org/software/coreutils/>

General help using GNU software:<http://www.gnu.org/gethelp/>

Report mkdir translation bugs to<http://translationproject.org/team/>

2.echo bash命令的使用

  echo off

  echo on

  @echo off  @echo on

3.cat bash命令的使用

 

以下是检测路径中是否包含有空格

# Make sure that there are no spaces in the absolutepath; the

# build system can't deal with them.

ifneq ($(words $(shell pwd)),1)

$(warning ************************************************************)

$(warning You are building in a directory whoseabsolute path contains)

$(warning a space character:)

$(warning $(space))

$(warning "$(shell pwd)")

$(warning $(space))

$(warning Please move your source tree to a path thatdoes not contain)

$(warning any spaces.)

$(warning************************************************************)

$(error Directory names containing spaces notsupported)

endif

1.words函数在make 文件中的使用

2.pwd bash 命令中的使用

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值