#!/bin/bash
let x=2 y=2**3
(( w=(y/x) + ( (~ ++x) & 0x0f) ))
echo $? w=$w
[beyes@localhost shell]$ sh cal.sh
0 w=16
[beyes@localhost shell]$ [[ ( -d "$PWD" ) && ( -w "$PWD" ) ]] && echo "Current directory is $PWD and it is writable"
Current directory is /home/beyes/shell and it is writable
[beyes@localhost ~]$ [[ "./ is represent current-directory" == ?/\ i* ]]; echo $?
[beyes@localhost ~]$ [[ "./ is represent current-directory" == ?/\ i* && 3 > 2 ]]; echo $?
0
[beyes@localhost ~]$ [[ "./ is represent current-directory" == ?/\ i* && a > 2 ]]; echo $?
0
[beyes@localhost ~]$ [[ "./ is represent current-directory" == ?/\ i* && a -gt 2 ]]; echo $?
1
[beyes@localhost ~]$ [[ "./ is represent current-directory" == ?/\ i* && 3 -gt 2 ]]; echo $?
0
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |