Enterprise Networking Planet   Earthweb  
Images Events Jobs Premium Services Media Kit Network Map E-mail Offers Vendor Solutions Webcasts
   subjects:
EnterpriseNetworkingPlanet Webcasts:
Blades Burst Onto Data Center Scene

Will Virtualization Pay Off for Your Enterprise?

Benefit Now from Improved Data Center Management

more Webcasts...


Network Security & Privacy Blog
Google Stays Classy in "Privacy" Backpedal

More on Google/YouTube/Viacom

Your Editor Was Distracted

More Open Networks Today



Search EarthWeb Network

internet.commerce
Be a Commerce Partner
Laptops
Compare Prices
Dental Insurance
Hurricane Shutters
Memory Upgrades
Computer Deals
Online Shopping
Online Education
Desktop Computers
Domain registration
Phone Cards
Logo Design
Free Business Cards
Promotional Products

Networking & Communications : Administration & Management: Scripting Clinic: Have a Bash with This Linux Shell

Everything Has Changed

See how Intel developed the cure for deskside help visits in this video directed by Christopher Guest of Spinal Tap fame. Click here.
 
Win a Laptop in the Intel Resource Center Scavenger Hunt
Scour the Internet.com Intel Resource Center for clues that spell out the name of an Intel technology. Collect the letters and, with the help of one final clue, arrange the letters to get the name of the Intel technology and you can be entered to win a Lenovo x300 laptop or an Apple iPod Touch. Start your hunt here! »
 
Cross-client Centrino® and  Core™2 processor with vPro™ Processor Technology Technical White Paper
A deeper technical dive on how vPro usage models work on both desktop and notebook PCs. Click here.
 
Intel® vPro Technology ROI Estimator
Intel® Core2™ Duo and Centrino® with vPro™ Processor technology cross-client ROI estimator. Click here.
 
WiPro Intel® Centrino® Pro with vPro™ Processor Technology
The Benefits of Intel® Centrino® Pro Processor Technology in the Enterprise. Click here.
 
Workstations Products Platforms Brief
Intel’s family of workstation platforms gives you the tools to move from serial to parallel workflows and enables you to iterate through alternatives faster and innovate more. Click here.
 
Itanium Solutions
Learn how Itanium®-based solutions are changing the way enterprises do business. Click here.

Glossary
directory service
honeynet
intranet
intrusion detection system
network appliance
NFS
port scanning
protocol
security
VPN
Search for more networking terms ...
 
FREE Tech Newsletters

Q&A with Bob Muglia: Senior VP, Server and Tools Division. Learn how Microsoft's new interoperability principles and the steps the company is taking to increase the openness of its products.

Scripting Clinic: Have a Bash with This Linux Shell
February 6, 2004
By Carla Schroder

Welcome to Scripting Clinic, the first installment of our monthly column on scripting.

Any Linux administrator who wishes to remain sane relies heavily on scripting to automate routine tasks, customize jobs, and build the plumbing that connects the different utilities that make a Linux system run smoothly. The Linux world is chock-full of scripting languages: Perl, Python, PHP, Scheme, Tcl, Tk, Ruby, Forth, Smalltalk, Eiffel, and doubtless many more. To get the column started, we'll look at shell scripting with Bash, and scripting with Python and Perl.

Understanding what Bash does is fundamental to using Linux. Bash is a command interpreter, the direct interface between you and your Linux system. Python is easy-to-learn, yet capable of handling any system administration chore. Perl is endlessly flexible, which makes learning it rather vexing at times. But it can do almost anything: Complex programs are written in Perl, such as the indispensible game Frozen-Bubble.

Scripting and text-and-file processing go hand-in-hand. So we'll also incorporate regular expressions, awk, sed, find, sort, uniq, and other text-and-file processing utilities. Half of using Linux is simply learning all these odd little specialized commands. Here is where the real power of Linux/Unix lies: All these little, specialized programs can be strung together in any way you need. You're not limited by some program author's idea of what you need, so you can use these building blocks to construct your Linux house the way you like it.

Bashing About
The default command shell on most Linux distributions is the Bash shell. Linux/Unix gurus adore silly wordplay; Bash stands for Bourne-again Shell. Bash is based on the Bourne Shell, the original command shell for Unix SysV systems. It incorporates features of the Korn shell, the C shell, and some new stuff of its own. Some folks love to debate command shells, and wax poetic over Csh, Tcsh, Zsh, and so forth. You are welcome to go nuts and experiment with any shells you like. Meanwhile, we're going to talk about Bash. (Should there come a time when you need to run a different shell, but don't want change your system default, simply invoke it from Bash: $ exec /bin/zsh)

For admins looking to master the shell game, the book "Linux In A Nutshell," by Ellen Siever, is indispensible. It's the best Linux command reference we've seen. It separates the built-in Bash shell commands from other commands, such as system administrator and user commands. Understanding what belongs to Bash will prevent a lot of confusion. Run this command to see what built-in commands are enabled on your system:

$ enable -a

This command displays all of your environment variables:

$ set

Bash Version

You should have version 2 or newer:

carla@windbag:~$ echo $BASH_VERSION
2.05b.0(1)-release

Unlike many Linux programs, Bash is mature, and does not change very often, so you don't have to worry about laboring to keep up with the latest and greatest.

Continued on Page 2

Go to page: 1  2  Next  

Tools:
Add www.enterprisenetworkingplanet.com to your favorites
Add www.enterprisenetworkingplanet.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed

Administration & Management Archives

Whitepaper: Rightsizing Blades for the Midmarket. Sponsored by HP.
Whitepaper: The Cost Advantages of Blade Servers. Sponsored by HP.
Intel Whitepaper: Wireless Technologies and e-Learning--Bridging the Digital Divide
Intel Whitepaper: Improve Security and Control of Your PCs
Intel eBook: Managing the Evolving Data Center





JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM eBook: Planning a Service Oriented Architecture
IBM eBook: Choosing the Right Architecture--What It Means for You and Your Business
Microsoft Article: Will Hyper-V Make VMware This Decade's Netscape?
Avaya Article: Using Intelligent Presence to Create Smarter Business Applications
Intel Go Parallel Article: Getting Started with TBB on Windows
Microsoft Article: 7.0, Microsoft's Lucky Version?
Avaya Article: How to Feed Data into the Avaya Event Processor
IBM Article: Developing a Software Policy for Your Organization
Microsoft Article: Managing Virtual Machines with Microsoft System Center
Intel Go Parallel Article: Intel Threading Tools and OpenMP
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
HP Video: StorageWorks EVA4400 and Oracle
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Red Gate Download: SQL Toolbelt and free High-Performance SQL Code eBook
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
Silverlight 2 App and Walkthrough: Leverage Silverlight 2 with SQL Server and XML
IBM Article: Enterprise Search--Do You Know What's Out There?
HP Demo: StorageWorks EVA4400
Microsoft Article: The Progress and Promise of Deep Zoom
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES