http://goo.gl/EmKxy0

Home > UNIX > Unix – Bits & Pieces

Unix – Bits & Pieces

Escaping
========
1. Single quotes protect all special characters except single quote
e.g. $echo ‘Hi, “ life is all about making sense out of non sense – By Sybanurag’
output – Hi, “ life is all about making sense out of non sense – By Sybanurag

2. Double quotes don’t protect double quotes and $ and `(backquote)
e.g. $echo “Hi, “ life is all about making sense out of non sense – By Sybanurag”
output — Hi, life is all about making sense out of non sense – By Sybanurag

3. Double quotes protect single quotes, and single quotes protect double quotes.

Process Basics
===========
1. When two users run the same same program, there is one program on disk but two processes in memory.

Problem 1
——–
Can a process be orphand?

Solution 1
———
Every process has a process, you can’t have an “orphaned” process, though a process can remain in orphaned state for a small moment.

SHELL
=====
Dot Matching
————
* and ? don’t match a filename starts with a dot.
* and ? don’t match the / in a pathname.

Character Class
—————-
[] is a character class.
The expression [a-zA-Z]* matches all filenames beginning with an alphabet, irrespective of case.
*.[!co] – Matches all filenames with a single-character extension but not the .c or .o files.
[!a-zA-Z]* Matches all files names that don’t begin with an alphabetic character.

cp $HOME/prog_sources/*.{c,java} — Copy all files in a directory having extension c or java
cp $HOME/source/{project, html}/* — Copy all files from the directories project and html

Check the Sybase Wiki @ sybasewiki.com
Categories: UNIX Tags:
  1. No comments yet.
  1. No trackbacks yet.