WARNING AND NOTICE

All tricks in this blog are only for educational purpose. Learn these tricks only for your knowledge. Please donot try these to harm any one. We will not take any responsibility in any case. All softwares and tools on this site are here for private purposes only and If you want to use a software for business purpose, please purchase it. I do not host many of these tools. I Post links that I have found from numerous Search engines. I will not be responsible for any of harm you will do by using these tools.

Readmore

Friday, September 24, 2010

SHELL PROGRAMMING QUICK REFERENCE GUIDE

SHELL PROGRAMMING QUICK REFERENCE GUIDE SPECIAL CHARACTERS; commandseparator ( ) execute commands in subshell { } execute commands in current shell # comments $var variable & execute in the … … background` substitute standard out’ quote all characters in a string” as ‘ but allow substitution REGULAR EXPRESSIONS. match any single character$ match preceding regular expression at the end of a line^ match preceding regular expression at the beginning of a line* match zero or more occurrences of preceding expression[ ] match any character … UNIX shell programming featuring korn shell u3711s course overview This 3 day course is a basic user course. It is also the prerequisite for the UNIX programming curriculum.

SHELL PROGRAMMING QUICK REFERENCE GUIDE SPECIAL CHARACTERS ; commandseparator ( ) execute commands in subshell { } execute commands in current shell # comments $var variable & execute in the background ` substitute standard out ‘ quote all characters in a string ” as ‘ but allow substitution REGULAR EXPRESSIONS . match any single character $ match preceding regular expression at the end of a line ^ match preceding regular expression at the beginning of a line * match zero or more occurrences of preceding expression [ ] match any character in the brackets (or range, i. e. 2-8) [^ ] match any character not in brackets (i. e. , ^0-9 means nonnumeric character) \\ last regular expression encountered \ (exp\) remember expression for later reference \{m, n\}number of times occurring, with m \{m\} indicating minimum and n \{m, \} indicating maximum COMMANDS exit code Exit shell with code return code break level Escape from level of for or while loop continue level Continue from level of for or while loop read Read input from a file test Evaluate an expression or condition trap Used for error handlingLOOPING FOR for variable in file/list do command done WHILE/UNTIL while/until test/condition do command done CASE case option in option 1 ) command ; ; option 2 ) command ; ; *) command ; ; es a c (* is any non-defined option) IF if test/condition then command elif test/expression then command else command fi REPETITION xargs -n (see man page for more options) VARIABLE EXPANSION ${var}simple variable substitution ${var: =value} assign default value if not defined ${var: +value} substitute value if var is non-null ${var: -value} temporarily assign value if non-null ${var: ? value} issue error with value if var not set, otherwise substitute value

Download SHELL PROGRAMMING QUICK REFERENCE GUIDE.Pdf

0 comments:

Post a Comment