Name :- Abhishek Vishwakarma
Assignment date:- 15th September 22
Submission Date :- 16th September 22
Topics :- Shell File Test Operators
1. Operator :- -b file
Description :- Checks if file is a block special file; if yes, then the condition
becomes true.
Example :- [ -b $file ] is false.
2. Operator :- -c file
Description :- Checks if file is a character special file; if yes, then the
condition becomes true.
Example :- [ -c $file ] is false.
3. Operator :- -d file
Description :- Checks if file is a directory; if yes, then the condition becomes
true.
Example :- [ -d $file ] is not true.
4. Operator :- -f file
Description :- Checks if file is an ordinary file as opposed to a directory or
special file; if yes, then the condition becomes true.
Example :- [ -f $file ] is true.
5. Operator :- -g file
Description :- Checks if file has its set group ID (SGID) bit set; if yes, then
the condition becomes true.
Example :- [ -g $file ] is false.
6. Operator :- -k file
Description :- Checks if file has its sticky bit set; if yes, then the condition
becomes true.
Example :- [ -k $file ] is false.
7. Operator :- -p file
Description :- Checks if file is a named pipe; if yes, then the condition
becomes true.
Example :- [ -p $file ] is false.
8. Operator :- -w file
Description :- Checks if file is writable; if yes, then the condition becomes
true.
Example :- [ -w $file ] is true.
9. Operator :- -r file
Description :- Checks if file is writable; if yes, then the condition becomes
true.
Example :- [ -r $file ] is true.
10. Operator :- -e file
Description :- Checks if file is writable; if yes, then the condition becomes
true.
Example :- [ -e $file ] is true.
11. Whileloop:-