Logowww.asingh.netHomeNewsBioInterestsTechnicalSearchContact



 Archive :

  May 2006
  June 2006
  July 2006
  July 2007
  August 2007
  April 2008
  June 2008
  December 2008
  January 2009
  March 2009
  June 2009
  January 2010

Korn Shell Scripting Tutorial

Just noting the link to a concise ksh tutorial that I came across. A more complete list of shell scripting notes is available here. Some additional notes :


Including other scripts: For better code/script organization if one wants to include a one script (say, include_script.ksh) in another script (say, main_script.ksh) following line in "main_script.ksh" will achieve it: . full_path/include_script.ksh Note the ".", without this "include_script.ksh" will get executed in a separte shell and its variable will not be visible in "main_script.ksh".

Variables Significant to ksh and sh: There is a good list here

Redirecting: All Unix process have 3 file descriptors by default 1 (stdout), 2 (stderr) and 3 (stdin). Following example shows how to redirect both stdout and stderr to same file:

ls -l > my_file 2>&1

(For more details see file duping section here)

posted by Amandeep 12/12/2008 11:14:00 PM | PERMALINK

As the title suggests, this is an addendum to the last entry which covered setting tip line between Sun Sparc system and another system running Solaris. When keyboard and monitor are not connected to the Sun Sparc system automatically directs the console to the serial port. Once the Sun Sparc and the PC were connected via a null modem cable, I was able to access the console easily using putty.

One issue is that the the serial port sends break signal to the Sun sparc system whenever the PC is powered off. This causes the Sparc system to drop to "ok" prompt. To prevent this from happening, I uncommented the following following line in /etc/defaults/kbd file on the Sun Sparc system, and rebooted it :

KEYBOARD_ABORT=alternate

This changes the break sequence to ~^b, thus providing the ability to drop the system to "ok" prompt when needed, while avoiding any confusion due to bogus break signals.

posted by Amandeep 12/12/2008 12:39:00 AM | PERMALINK

 

 

| Home | News | Bio | Interests | Technical | Search | Contact |

This page is powered

by Blogger.