Test commands in shell Programming

Source: Internet
Author: User
In shell programming, the test command-General Linux technology-Linux programming and kernel information is provided. The following is a detailed description. I just got started with linux and learned the shell programming if command (I have never touched programming before). there is a code on the book to view the file attributes. I don't understand it very well.
The original text is as follows:
#! /Bin/bash
# 4.10.sh
If test-z $1
Then echo 'Please input a file name'
Else
If test-w $1
Then echo "writeable"
Else
Echo "unwriteable"
Fi
If test-x $1
Then echo "excuteable"
Else
Echo "unexcuteable"
Fi
Fi
The above does not mean to output the please input a file name when the file name is not input in the test Command test.
The following should not be the writeable output when the test file cannot be written.
Is my understanding wrong? where is it?
Be considerate of the pains of self-study.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.