This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes Need unix shell script Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Need unix shell script Help" Watch "Need unix shell script Help" New topic
Author

Need unix shell script Help

saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
Hi All,

I need Unix Shell Script files for migration work.Here i am explaining hte scenerio ...

We are shifting an application from one production server to the other DCC(Data Center Consolidation) environment .
So we have all Unix boxes. so for migrating the stuff we need unix shell scripting stuff
So completely new to unix environment and shell script.
Yesterday I learnt some Unix Basic commands and Shell Scripting ,now I am planing to learn how the migration kind of work is done using shell script

In this issue i am unable to get the proper resource, Can any experienced person can give some information,links, for learning..
Please Help me out
I am thankful to you all

regards,
Sai Krishna



A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
Diego Freniche
Greenhorn

Joined: Dec 28, 2007
Posts: 8
We are shifting an application from one production server to the other DCC(Data Center Consolidation) environment .
So we have all Unix boxes. so for migrating the stuff we need unix shell scripting stuff


Have all machines the same UNIX OS? I mean, are they Linux, Solaris, HP-UX ? And most important, which UNIX Shell are you using, bash, sh, tcsh, csh, ...?
I know if this is your first UNIX-scripting time it's a hard time, but you'll learn things that haven't changed for ages. And you will learn tricks that you can use on your Windows boxes also (f.e., shutdown command, tab to complete filenames in cmd windows, symbolic links in NTFS, ...)

If you're using bash, try searching Google for bash course, bash book, or similar. A good web, but a little bit advanced, is: http://bashcurescancer.com/

There I found: http://www.pixelbeat.org/cmdline.html

But maybe you'll value http://www.freetechbooks.com/about180.html&highlight=bash

Kind regards, and go 4 it! It's always exciting to learn new things!


SCBCD 1.3, SCWCD 1.5, SCJP 1.5 & 1.6
saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
Thanks Diego,



But still I am little bit worried about my career .
Actually I am a Java Developer working on portals but mean while my project manager has assigned this work on priority.
So for the next 4 months I am going to work on this migration to DCC using unix shell script.
will it be worthful?
Please Suggest me
Thanks
Sai
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41180
    
  45
4 months is nothing over the course of a career. Migrations are one-off projects that just need to be done with. Presumably afterwards the usual work will continue on a better or more powerful platform, which should make the whole thing worthwhile. As said before, learning new things is good.


Ping & DNS - my free Android networking tools app
saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
Thanks for your encouragement,
MY tasks initially will be to migrated about 200 SAS-VMS scripts to HP-UX K-shell scripts and also to migrate some Java programs to HP-UX. I Need to focus on Korn shell scripting and SFTP and VMS to HP UX commands conversion..

So can You please give me some more information on these?
Doug Slattery
Ranch Hand

Joined: Sep 15, 2007
Posts: 294
Hi Saikrihna,

Korn shell is syntactically similar to the Borne shell (and bash), which are the predominant shell scripting languages in use.

Unix shell scripts are primarily command line commands and utilities hooked up with semantics for environmental variables, conditionals and looping. You'll probably spend most of your time tracking down which commands to use in your scripts as the scripting language itself is pretty straight forward.

One good (free) resource is the man pages (I assume at least one of your HP systems has the man pages installed). Man pages are the unix on line manual pages, or, man pages for short. At the command line, if you type:
$ man ksh
- or -
$ man sh
you will get the man page for the Korn or Borne shell if the man pages are installed. If not, you'll get something along the lines of a "file or directory does not exist" error.

There's several books on shell scripting out there, and if you get one, you want to be sure it covers the Korn shell. This is because others like the C shell are quite different.

You can also poke around your systems in the /bin, /usr/bin and /usr/sbin directories to see what kind of command line utilities are installed on your system.

Here's some introductory command line concepts to master:
Entering command line parameters
Three types of files: Regular, Directory and Device
Redirection and piping
Assigning and reading environmental variables
The process table
Running a process in the background
Signals
Kernel and User modes

Here's some useful command line utilities:
who, ps, cat, tr, cut, date, grep, uname, ulimit, mount, umount, mkdev, mknod, sed and awk.

Many years ago, I taught a week course on unix and shell scripting, so if you get stuck, ask away. It might also be helpful to post some vms snippets of what you're trying to do as well when you get stuck.

And yes, knowing shell scripting is very valuable. I've even written cgi's using just shell scripts !

Aloha,
Doug

-- Nothing is impossible if I'mPossible
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

That's really nice of Doug.

I am sailing the same boat of Saikrishna. I would also be pleased to post my doubts here and get it clarified from ranchers as usual


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

The links are awesome Doug. Especially the pixelbeat's commandline reference
kermit tensmeyer
Greenhorn

Joined: Jan 25, 2008
Posts: 2
another resource site that I found useful
Advanced Bash-Scripting Guide

Is there something interesting that you need to get done?
Kevin Weiss
Greenhorn

Joined: Mar 27, 2007
Posts: 7
Another good site I've referenced in the past...
http://www.shelldorado.com
Anand Hariharan
Rancher

Joined: Aug 22, 2006
Posts: 257

Originally posted by Raghavan Muthu:
The links are awesome Doug. Especially the pixelbeat's commandline reference


I think you meant Diego ....


"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- Antoine de Saint-Exupery
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

Originally posted by Anand Hariharan:


I think you meant Diego ....


Nope, his name is correct!
Doug Slattery
Ranch Hand

Joined: Sep 15, 2007
Posts: 294
Thanks for the kudo's Raghavan,

originally posted by Anand Hariharan:

I think you meant Diego ....

Nope, his name is correct!


Pixelbeat is Diego's, so he deserves credit there .

Aloha,
Doug

-- Nothing is impossible if I'mPossible
[ January 26, 2008: Message edited by: Doug Slattery ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need unix shell script Help
 
Similar Threads
Need help for Shell Script to reduce a file
Script to Find & Remove text in multiple files.
Calling a java program(main method ) from a shell script
Shell script for JVM heap size monitoring
unix scripting