| | Let's share UNIX commands. To start off, here are some.
-Hannah |
| Astahost.com | Mar 21, 2010 |
You're talking about writing a BASH script, right ?
Because "UNIX commands" is a very vague description which I interpret as commands to start an application (eg "ping 127.0.0.1"). function - create a function - Syntax: function myfunction() { and also, please, when you give such an info, give it completely. I'm pretty sure the heading "{" needs a trailing "}" in order the function description to be complete. and also, please, when you give such an info, give it completely. I'm pretty sure the heading "{" needs a trailing "}" in order the function description to be complete. Now that we're talking about mistakes. Usualy a string is places between " " , unless hello is a previously defined variable. So it should probably be CODE echo "hello" or CODE string hello = "Hello there"; echo hello; But it all depends on which language/environment you're using
In Unix I have observed the following two statements give the same results:
CONSOLE echo $SHELL CONSOLE echo "$SHELL" Both the methods will process the variable and prints which shell is running. To take the input as text, whether or not there are variables included, it would be included in single quotes CONSOLE echo '$SHELL' The output would be $SHELL Here are some more commands which are commonly used: tput clear # Clears screen ls -l > list #Saves the list of files and directories in the current directory with attributes (-l) in "list" file. cat filename # Display file contents wc list # Counts number of lines. x lines, x words, x characters Anything starting with hypen (-) is an option. It needs to be separate, that is no characters after or before it. tput clear # Clears screen Talking about tput, another interesting one is QUOTE tput sgr0 This resets your terminal to standard values, removing "rev", "blink" and other disagreeable features you got if you "cat" a binary file to your display.
Similar Topics
Keywords :
(2) Check out this super cool UNIX command line visual cheat sheet: Looking for Tips:, Unix, Commands
|
![]() Tips: Unix Commands |
Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com