รบกวนสอบถาม shell script ของ linux หรือ aix ก็ได้ เป็น script เกียวกับ if else
ตรวจสอบว่ามีไฟล์ /log/abc.log อยู่หรือไม่ หากมี ให้พิมพ์ "found" หากไม่มี ให้พิมพ์ "not found"
ตรวจสอบว่ามีไฟล์ /log/abc.log อยู่หรือไม่ หากมี ให้พิมพ์ "found" หากไม่มี ให้พิมพ์ "not found"
#!/bin/bash
if [ -a "/log/abc.log" ]; then
echo "found"
else
echo "not found"
fi