This is a discussion on Shell programming within the Shell Programming forums, part of the Operating Systems category; How can I manually program the shell? It would be interesting to write some custom scripts for me. Anyone expert ...
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Shell scripting is necessary for automating a broad range of administration tasks on servers related to UNIX and Linux Operating system. These scripts can be run manually to combine many steps into a single command. I have given below a simple shell script written manually to replace the command
find . -name file -print % cd ~/bin % emacs sfind % page sfind find . -name $1 -print % chmod a+x sfind % rehash % cd /usr/local/bin % sfind tcsh ./shells/tcsh |
|
|||
|
I have given below some hints and guidelines for you to try the shell scripting progra suggested by our friend. These are the steps needed to write and execute a shell script.
* Open the file using an editor like "vi" like vi sfind.sh * All shell scripts should begin with "#!/bin/bash" that is as given in the example depending upon the shell used by user. * Write the script fully in the file opened * The next step is to make the script executable by using the "chmod" command. as done in the example as % chmod a+x sfind * Then execution of script is done by entering the name of the script on the command line, preceded by its path. If it is current directory then ./followed by shell filename.sh would suffice. Try and let us know whether you were successful in running the script. |
![]() |
| Thread Tools | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Getting Started With Java Programming !! | insane | Java Tutorials | 7 | 04-26-2006 03:19 PM |
| C Programming - Decision Making - Branching | JobHelper | Career Advice | 0 | 04-15-2006 12:31 PM |
| Windows Vista : Programming Indigo: The Programming Model | techguru | Windows Vista Tutorials | 0 | 08-27-2005 05:00 AM |
| Position C/C++,HP-UX, Shell Script | kalareddy | Experienced Job Seekers - India | 0 | 06-07-2005 08:46 AM |
| Software Professionals - Fresher - C, C++, UNIX Shell Scripting | techguru | Freshers Jobs | 0 | 05-31-2005 10:20 PM |