Jump to content

Unix and Linux differences

DebiHopkins's Photo
Posted Jul 08 2011 06:10 AM

My company is converting over from Unix operating system (running on HP) to a Linux under GNU. We are running korn shell now, moving over to bash.

I have been in an HP-UX environment for 15 years and am quite proficient in scripting.

My question is would I benefit from buying a Linux handbook/nut shell book?

I love the O'Reilly books and am the owner of several.
I still refer to my "Unix in a Nutshell" and hardly ever lend it out to anyone as it is my 'bible'!

Just wasn't sure if there a great difference.

Thanks for your help!

"Books are our friends"

1 Subscribe

6 Replies

+ 2
  macnlos's Photo
Posted Jul 08 2011 06:29 AM

If you have been working with HPUX for 15 years your struggle will not be with what to do on the system, but more of how to do it. In many cases it will be similar commands but with different parameters. One area that you will need to focus on is installation and patching processes since they will be different.

If you are moving from Korn to Bash just pick up the O'Reilly Learning Bash and get the rest from the web. If I were you, I would seriously consider taking the opportunity to migrate your heavy scripts/mini aps to Perl. This will position to take/use those scripts on many platforms. You need to know and use Bash but I think defaulting to Perl will work out better in the long run.

Another book that may be of assistance, and it's inexpensive, is the O'Reilly Linux Pocket Guide. Of course there are numerous O'Reilly Perl books, but there is one specifically for System Administration. That book along with the Cookbook will go a long way.

Sent to you from my
iPad, iPhone, BlackBerry,
Laptop, Desktop, or
Kitchen Toaster
  e123s456's Photo
Posted Aug 13 2011 04:51 PM

Hi, Debi. I cannot speak for others, but I can tell of what I have seen. In transferring scripts from HPUX to Linux, I have observed that most scripts written under the Bourne shell (the default sh shell under HPUX) will run OK without change under korn or bash as far as the basic script mechanics go. In other words, environment variables work about the same, "while" loops work about the same, etc. That is because the functionality supplied by the bash shell is largely a superset of the functionality of korn and sh.

The rubbing points you will most likely encounter will be differences in non-shell-based commands between HPUX and Linux. These differences will be most apparent in the commands involved in software maintenance and in host hardware configuration and monitoring.

The basic Unix stuff like awk, sed, and grep will work much the same because in most cases of differences between HPUX and Linux, the awk/sed/grep stuff under Linux will be mostly supersets of the corresponding commands under HPUX. Consequently, going from HPUX to Linux can be considerably easier than going from Linux to HPUX as far as script functionality goes.

To answer your question, OReilly's bash shell book would be a good thing to pick up. And if they carry a book on the flavor of Linux you are moving to, that would be a good investment as well. Their Linux in a Nutshell book would be another excellent book to consider. I hope this helps.
+ 1
  Purple26's Photo
Posted Aug 21 2011 04:12 AM

My company is also gradually putting more emphasis on linux and I haven't found much resources describing differences between the unix flavours, on top of the issue that your linux distribution version might be different than others (there are dozens).

I'll give you two tips: bdf works in HP, not in linux, and you have to watch out for hardcoded mentions of executables. Many linux 'core' executables are found in /bin as opposed to the other locations /usr /opt /sbin etc...
  AdrienLamothe's Photo
Posted Aug 22 2011 02:23 PM

The Korn shell is available for Linux. If you are running a Debian based distro, such as Ubuuntu, Mint, Debian, etc. you simply install the ksh package. You would install it from the command line like so: $ sudo apt-get install ksh Simple as that.

For Red Hat, SuSE and other distros using RPM, there are a number of rpm packages for ksh, each for a different ksh version; they usually have the ksh version name contained in the rpm package name.

I would install ksh on your new Linux machine and start with that until you insure the scripts will run with some other shell you may want to use (such as bash).
  macnlos's Photo
Posted Aug 23 2011 07:12 AM

While I understand what Adrien is saying here, I don't agree actually doing it..you are changing platforms and will already experience some level of change. Take this opportunity, it doesn't come often, to go with a shell you can expect on any current/modern *nix box. I'm not saying ksh, bsh, zsh, or any other shell is better than the other. I'm saying if you are given a new system you can expect bsh to be there.

For me it's like forcing everyone one I work with to know vi. Yes emacs and other editors are just fine but I know Vi will be on whatever box I go to. So my vote still stands. Migrate to bash and use Perl as much as possible.
Sent to you from my
iPad, iPhone, BlackBerry,
Laptop, Desktop, or
Kitchen Toaster
  AdrienLamothe's Photo
Posted Aug 26 2011 09:48 AM

My suggestion was to stick with Korn for the interim, while modifying and testing the scripts for BASH, unless she has the luxury of completely testing them under BASH before migrating to the new servers. The least painful method is to gradually convert and test each script to BASH, especially if a large number of scripts are present.