C Shell operators

This tutorial lists all the operators available in C Shell. Here, most operators are similar to those we have in the C Programming Language.

This tutorial lists all the operators available in C Shell. Here, most operators are similar to those we have in the C Programming Language.

Operators are listed in descending order of priority.

Logical and arithmetic operators in Unix / Linux

Operator Description () Change of priority ~ Compensation! Negative permission * Multiplication / Division% Split division + Addition - Subtraction << Left shift >> Right translation == Comparing string with! = Comparing string not equal = ~ Matching pattern & AND Bit permission ^ XOR Bit (Or exclude) | OR bit && AND logic || Logical OR logic + Quantitative - Decrease = Assignment * = Multiply left to right and assign to left / = Divide left to right and assign to left + = Add left and right and assign to the left - = Subtract the left to the right and assign to the left ^ = XOR to the left and right and assign the result to the left% = Divide to the left and to the right and get the left to the left

File checking operators in Unix / Linux

The following table lists the operators to check the various characteristics of a Unix file.

Operator Description-r file Check if the file is readable, if yes, the condition is true. -w file Check if the file is writeable, if yes, the condition is true. -x file Check if the executable file (execute) is true or not, if yes, the condition is true. -f file Check if the file is a file that is often in contrast to a particular folder or file, if it is, the condition is true. -z file Check if the file is larger than 0, if it is, the condition is true. -d file Check if the file is a directory, if any, the condition is true. -e file Check if the file exists. Is true even if it is a directory but exists. -o file Check if the user owns the file. It returns true if the user is the owner of the file.

According to Tutorialspoint

Previous article: Basic Shell operators

Next post: Operator Korn Shell

You've just finished reading the article "C Shell operators" edited by the TipsMake team. You can save c-shell-operators.pdf to your computer here to read later or print it out. We hope this article has provided you with many useful tech tips and tricks. You can search for similar articles on tips and guides. Thank you for reading and for following us regularly.

« PREV : Korn Shell Operator...
Basic Shell... : NEXT »