zl程序教程

您现在的位置是:首页 >  系统

当前栏目

【shell 脚本】删除 由windows传入linux含有的 ^M

LinuxWindowsshell 删除 脚本 传入 含有
2023-09-14 08:57:15 时间
=========测试==========
"varify_ture.sh" [converted][dos] 119L, 2611C written                                              
root@client.example.com ~/yang # ./varify_ture.sh  
: command not foundine 2:
: command not foundine 6:
: command not foundine 7: echo
: command not foundine 8:
Testing "0"
./varify_ture.sh: line 15: syntax error near unexpected token `fi
./varify_ture.sh: line 15: `fi            # 0 Ϊ
===================================
root@client.example.com ~/yang # ./dropblank.sh varify_ture1.sh  varif_2.sh
root@client.example.com ~/yang # ./varif_2.sh

Testing "0"
0 is true.

Testing "1"
1 is true.

Testing "-1"
-1 is true.

Testing "NULL"
NULL is false.

Testing "xyz"
Random string is true.

Testing "$xyz"
Uninitialized variable is false.

Testing "-n $xyz"
Uninitialized variable is false.

Testing "-n $xyz"
Null variable is false.

Testing "false"
"false" is true.

Testing "$false"
"$false" is false.

root@client.example.com ~/yang #