原创作品,允许转载,转载时请务必以超链接形式标明文章
原始出处 、作者信息和本声明。否则将追究法律责任。
http://dgd2010.blog.51cto.com/1539422/1542048
-
string1==string2
-
string1=string2
-
True if the strings are equal. ‘=’ should be used with the
test
command for POSIX conformance. -
string1!=string2
-
True if the strings are not equal.
-
string1<string2
-
True ifstring1sorts beforestring2lexicographically.
-
string1>string2
-
True ifstring1sorts afterstring2lexicographically.
-
arg1OParg2
-
OP
is one of ‘-eq’, ‘-ne’, ‘-lt’, ‘-le’, ‘-gt’, or ‘-ge’. These arithmetic binary operators return true ifarg1is equal to, not equal to, less than, less than or equal to, greater than, or greater than or equal toarg2, respectively.Arg1andarg2may be positive or negative integers.
1
|
[[
"$1"
-
eq
""
]] &&
echo
"delete all spaces and comments of specialized file, using with $@ filename"
&&
exit
1
|
1
|
[[
"$1"
==
""
]] &&
echo
"delete all spaces and comments of specialized file, using with $@ filename"
&&
exit
1
|
1
2
3
4
|
#!/bin/bash
# delete all spaces and comments of specialized file, using with $@ filename
[[
"$1"
==
""
] &&
echo
"delete all spaces and comments of specialized file, using with $@ filename"
&&
exit
1
grep
-
v
\
# $1 | grep -v ^$
|
1
2
3
4
5
6
7
8
9
10
|
cat
> delsc.sh << eof
#!/bin/bash
# delete all spaces and comments of specialized file, using with $@ filename
[[
"\$1"
-==
""
]] &&
echo
"delete all spaces and comments of specialized file, using with \$@ filename"
&&
exit
1
grep
-
v
\
# \$1 | grep -v ^$
eof
chmod
+x .
/delsc
.sh
\
mv
delsc.sh
/usr/local/bin/delsc
which
delsc
cat
/usr/local/bin/delsc
|
1
|
delsc filename
|