Sams Teach Yourself Shell Programming in 24 Hours (Free web hosts)

Sams Teach Yourself Shell Programming in 24 Hours Contents Index Hour 23: Scripting for Portability Previous Chapter Next Chapter Sections in this Chapter: Determining UNIX Versions Questions Techniques for Increasing Portability Terms Summary Previous Section Next Section Hour 23 Scripting for Portability Shell programming is an important part of UNIX because shell scripts are portable between different versions of UNIX. In many cases, no changes are required for a shell script to function correctly on multiple systems. The easiest way to ensure that your shell scripts are completely portable is to restrict yourself to using only those commands and features that are available on all versions of UNIX. Sometimes, you have to implement workarounds to deal with the limitations of a particular version of UNIX. In this chapter, you will first learn how to determine which version of UNIX is running. Then you will learn how to adapt your shell scripts to different versions of UNIX by examining some of the problems encountered when porting scripts between the versions. Determining UNIX Versions BSD Versus System V Determining the UNIX Version Using a Function Using uname Before you can begin adjusting shell scripts to be portable, you need to know what the different types of UNIX are and how to tell them apart. The two major types of UNIX are l BSD (Berkeley Software Distribution) l System V The locations of commands and the options supported by certain commands are different between these two types of UNIX. This chapter highlights the major differences and commands in particular. BSD Versus System V BSD UNIX was developed by the Computer Systems Research Group at the University of California at Berkeley. In the early 1980s, the University of California acquired the source code to UNIX from AT&T Bell Labs and significantly modified it to produce BSD UNIX. Although the University of California has stopped distributing BSD UNIX, current versions of it are available from many sources. The most common versions of BSD are OpenBSD, NetBSD, and FreeBSD. Some older machines from Sun Microsystems run a modified version of BSD called SunOS.
If you are looking for affordable and reliable webhost to host and run your business application visit our ftp web hosting services.

Leave a Reply