User: Sign In
Mobile
Can
11,846 photos 2014: 311 2013: 827 | 2012: 730
Tempe
Arizona
Sedona
Search Sum
Minis Special
Exif Wide
1
5
10
12
Navigator
1.* Photos *
|
2.Best/Pano/Minis
|
3.My Adventures
|
4.Travels
|
5.Questions/Answers
|
6.Prog
|
7.Maps
|
8.Cool
Programming
1.Unix
|
2.* Perl *
|
3.PHP
|
4.ASP.NET
|
5.ASP
|
6.Visual C++
|
7.Visual Basic
|
8.JavaScript
|
9.HTML
|
10.CSS
|
11.CGI, bin and Perl
|
12.Cygwin
|
13.Linux
|
14.mySQL
|
15.Python
|
16.robertbody C++ & *.BAT
|
17.Unix Notes (live)
|
18.Perl Notes (live)
(Navigator)
1.* Photos * | 2.Best/Pano/Minis | 3.My Adventures | 4.Travels | 5.Questions/Answers | 6.Prog | 7.Maps | 8.Cool

Programming

1.Unix | 2.* Perl * | 3.PHP | 4.ASP.NET | 5.ASP | 6.Visual C++ | 7.Visual Basic | 8.JavaScript | 9.HTML | 10.CSS |
11.CGI, bin and Perl | 12.Cygwin | 13.Linux | 14.mySQL | 15.Python | 16.robertbody C++ & *.BAT |
17.Unix Notes (live) | 18.Perl Notes (live)

Unix

-  +
see also: [ CGI, bin and Perl ] in section bin/ section for script examples of tgz, untgz, etc bg, fg, fg %2
a few examples follow, and [ Unix Notes (live) ] - server resident file, has many more examples
#-------------------------------------shell-------------------------------------
PS1='$PWD> '           # prompt showing current directory
PATH=$PATH':whatever'  # append to path
cd -                   # previous directory

#-------------------------------------date-------------------------------------
date -v-7H "+%A %l:%M:%S %p, %Y-%m-%d"   # Friday  3:59:50 PM, 2003-09-12 ( -7 hours from GMT specified )
date +"%Y-%m-%d-%H-%M"                   # 2005-11-09-13-19

#-------------------------------------tar-------------------------------------
# tar -c create, -x extract, -f file, -v verbose
  tgz: tar -cvf - $* | gzip > my.tgz       # "-" alone important 
untgz: gunzip -c my.tgz | tar -xvf -

#-------------------------------------scripts-------------------------------------
for ((x=1;x<20000;x++)); do clear; ls -al; sleep 5; done    # for (c-style) loop
for i in $* ; do echo $i; done;        # for-in loop; all ARGV command line arguments 

#-------------------------------------strings-------------------------------------
echo "Make LOWERCASE" |  tr A-Z a-z # convert from uppercase to lowercase
ls -w | sed s/www.robertbody.com./RB:/              # replace "www...com" with "RB:"

#-------------------------------------scripts-------------------------------------
tail -200 file* | grep -B1 redirect
ls -w | sed s/www.robertbody.com./RB:/

for i in $* ; do
  if [ -a $i ]; then               # if file exists (specified as parameters)
    echo "$H $i <-- ok";
  else
    echo "$H $i <-- does not exist"; allFound=0;
  fi;
done;
#-------------------------------login script example------------------------------
/www/robertbody/robertbody.com> cat r
echo "...robertbody setup..."
echo "   PS1='\$PWD> '"
echo " MYBIN=/www/robertbody/robertbody.com/cgi-bin/bin"
echo "     C=/www/robertbody/robertbody.com/cgi-bin/counter"
echo "  PATH=.:\$PATH:\$MYBIN"
echo "......................"
PS1='$PWD> '
MYBIN=/www/robertbody/robertbody.com/cgi-bin/bin
C=/www/robertbody/robertbody.com/cgi-bin/counter
PATH=.:$PATH:$MYBIN
find . -name '*.html' | xargs grep -L '</html>'   # find *.html files (within subdirs) which don't have </html>

tar -xvf /cygdrive/c/robert-backup/2009-09*.tgz --wildcards --no-anchored 'ola'  # extract filenames with 'ola'

www.bell-labs.com - History of Unix
www.ee.surrey.ac.uk - Teaching Unix
Links - Regular Expressions:
http://search.cpan.org/~jhi/perl-5.8.0/pod/perlretut.pod#Extracting_matches - Extracting matches

sed
Xterm FAQ - dickey
Counter:
Last Updated: Wed, November 23, 2005 21:32