Showing posts with label Change Log. Show all posts
Showing posts with label Change Log. Show all posts

Wednesday, October 14, 2020

LinuxCommand.org is Twenty Years Old...

That's right, it's been twenty years since I launched the first version of LC.o and began this journey of Linux advocacy and education. Over the years, a lot has changed and a lot has stayed the same.

Many years ago, when Linux was young, Linus Torvalds gave a talk at a Linux users group meeting. At this point in Linux history, Linus had to actually use PowerPoint to present his slides as no office suite yet existed for Linux. During his talk he began to discuss the goals of the Linux project. He said something to the effect, "Of course, the true goal of Linux is..." and he brought up his next slide which read "TOTAL WORLD DOMINATION" at which point the audience erupted into complete laughter. At the time, the very idea of this little hobbyist project being able to compete with Microsoft Windows or even mainstream Unix seemed utterly preposterous.

Fast forward to today and we see that Linux has indeed achieved total world domination. It powers 80% of the world's smart phones, almost all of the Internet, Chromebooks, automotive infotainment systems, and countless embedded systems. Commercial Unix has largely disappeared and even Microsoft is starting to get onboard. Yet, despite all this change, the command line endures. Over the last 20 years there have only been three major releases of the bash shell. Scripts written back in the 1990s still work fine today. The same goes for most of the common utilities, too.   

In honor of my 20 year milestone, LC.o has been extensively modernized. Several weeks of re-engineering have resulted in the following improvements:

  • New responsive design. The site now renders usefully on devices of all sizes from desktops down to most common mobile phones.
  • Simplified, modern HTML and CSS. These improvements should result in better page performance.
  • Updated tutorials. The text has been reviewed and modernized. While still very sparse compared to the corresponding sections in the book, the online tutorials are at least up to date. Many of the tutorials now feature "Further Reading" sections with links to supplemental material.
  • Manual pages. A complete set of man pages is now provided for the bash builtins, GNU coreutils package (which comprise most of the common command line utilities one encounters on a Linux box), and many other common utilities.

Many thanks to all the folks who have taken the time to write and provide feedback and encouragement. Without you, I might not have kept at it for so many years.  I hope that everyone enjoys the new LC.o and maybe I can squeeze another 20 years out of it (though by then I will be a seriously old man).

Wednesday, August 19, 2020

Adventure: SQL

Structured Query Language (SQL) is the lingua franca of the database world. It's also a useful and important skill. In this adventure, we will look at its major features and techniques, as well as discover a command-line tool that makes SQL easy to use with our scripts and projects.

http://linuxcommand.org/lc3_adv_sql.php

Thursday, May 14, 2020

Adventures: Coding Standards, Parts 1 and 2

Good news everyone! I have just posted 2 new adventures! In this two-part series we look at bash script coding standards.

In Part 1, we review what a coding standard does and how they work. We next create our own standard called the LinuxCommand Bash Scripting Style Guide.

In Part 2, we look at the new_script program, a bash shell script template generator that makes using our new coding standard fun and easy. Enjoy!

Coding Standards Part 1
Coding Standards Part 2

Saturday, March 21, 2020

Adventure: source

We looked at the source builtin a little in TLCL when we were examining how the shell's environment is established with the .profile and .bashrc files. In this adventure, we will delve further into how to use this feature to support configuration files and shareable function libraries for our bash scripts.

http://linuxcommand.org/lc3_adv_source.php

Saturday, April 27, 2019

(Not so new) Adventure: Vim, with Vigor

A few months ago I wrote an adventure but I forgot to announce it. In it, we advance our skill with the vim text editor from the beginner level to an intermediate level. This adventure is one of my favorites so far. I learned a lot while writing it.

Vim is a very capable and configurable program. For example, it's easy to configure vim to behave differently according to the type of file it is editing and in this adventure we will configure vim to be optimized for writing shell scripts and plain text documentation files making vim a useful partner when working on the command line. We also introduce a number of powerful editing tricks that make using vim a lot more fun.


You can find the Vim, with Vigor adventure here.

Tuesday, June 21, 2016

Adventure: Other Shells and Power Terminals

Two new Adventures! First, we'll look at some of the other shell programs available to Linux users. Most are of historical interest, but one attempts to do bash one better. Learn more about Other Shells.

Second, we'll explore some of the often overlooked features of our most frequently used command line tool-- our terminal emulator. Explore Power Terminals.


Enjoy!

Tuesday, January 26, 2016

Adventure: AWK

Another new Adventure! The AWK programming language is one of the truly classic Unix tools still in wide use today. Often embedded in shell scripts or employed directly at the command line, this powerful and elegant text processing and pattern matching language is a must-have for every Linux user's toolbox. In this adventure, we'll try it out.

Thursday, February 5, 2015

Adventure: dialog

Another new Adventure! dialog is a program that, as the name might suggest, creates dialog boxes in text mode. We can use it to give our scripts a friendly face. In this adventure, we will look at what it does, and how to use it.


Friday, November 7, 2014

Adventure: tput

Another new Adventure! Tired of looking at the same old text? Learn how to add color and text effects to your scripts with tput.


Monday, May 12, 2014

Adventure: Less Typing

Another new Adventure! Fingers getting tired? Making more mistakes than you should? You should learn to do more with Less Typing!



Tuesday, March 25, 2014

Adventure: Terminal Multiplexers

I have just posted another Adventure! This one explores terminal multiplexers; programs that allow your terminal to perform clever tricks. Enjoy!



Monday, March 3, 2014

Adventures

I have just posted the first unit of a new series on LinuxCommand.org called Adventures. These are tutorials that supplement my book, The Linux Command Line.

The first tutorial in the Adventures series is Midnight Commander. Midnight Commander is a text-based directory browser and file manager. A very powerful and useful program.


Look for more Adventures in the coming weeks. Enjoy!

Friday, January 17, 2014

A Couple More Scripts

I have just posted 2 new bash scripts on the Resources page for your edification and enjoyment. They are:

my_cloud - A script to store and manage files on a remote server (a kind of stone-age Dropbox).

photo2mail - A script that re-sizes images. Used to make image files suitable for use as email attachments.

In addition, I have updated new_script to support a more modern coding standard.

Enjoy!

Sunday, October 14, 2012

new_script Version 3

The most popular script on the old version of LinuxCommand.org was new_script, a bash shell script that created bash shell scripts. That is, a script template generator. A few months ago I rewrote new_script to modernize it and make better use of bash features, including arrays. The new version is less than half the length of the previous version and yet it does more.

Using new_script will save you a lot of work by creating a customized template incorporating a parser for your script's command-line options and arguments. The template also includes a number of useful housekeeping routines such as error and signal handlers. The generated script is fully functional (though it does nothing) and is ready for you to insert your program-specific logic.

Synopsis


new_script [-h|--help] [-q|--quiet] [-s|--root] [script]

Description


new_script will, by default, prompt the user for details about the script to be generated:

Enter script output filename >

Choose a name for the generated script file.

Enter purpose of script >

Enter a one-line description of the script.

Include GPL license header [y/n]? >

Entering "y" will insert a GPL license header into the comment block at the beginning of the script.

Does this script require superuser privileges [y/n]? >

Entering "y" will insert a routine that verifies the user has superuser privileges before allowing the script to execute.

Does this script support command-line options [y/n]? >

If you intend to support command-line options for your script, answer "y".

Option 1:
Enter option letter [a-z] (Enter to end) >

If command line options are desired, a series of prompts will appear. First, you will be asked for the short (single letter) form of the option. Enter a letter in the range of a-z to define the option or enter nothing to end the option input loop.

Description of option ------------------->

Enter a short description of the option. This will be used in the "help" message.

Enter long alternate name (optional) ---->

Enter a single-word long option name if desired. For example, if you have an option "h" for a help function, you can specify an alternate long form name for the option such as "help." When your script is executed, you can invoke the help function by including either -h or --help on the command-line.

Note that new_script always includes the "h" and "help" options automatically by default.

Enter option argument (if any) ---------->

If your option requires an argument, enter a single-word descriptor here. For example, if you were creating a script named my_script supporting both an input and an output file, you might have an option for each with their corresponding arguments such as:

my_script -i infile -o outfile

After you finish entering your option information, new_script will generate your custom script template.

Your script will contain a handy error handling routine called error_exit, which is used like this:

error_exit error_message

where error_message is a string containing a descriptive error message. The error_exit function outputs the error_message string to standard error, calls the clean_up function to perform any necessary housekeeping, then exits with an exit status of 1. Here is an example:

error_exit "Something bad happened!"

You can see other examples within the new_script code itself.

Options


The new_script program supports the following command-line options:

-h, --help
Display a help message and exit.

-q, --quiet
Quiet mode. Do not prompt user for script information and output default script to standard output.

-s, --root
Require superuser privileges for execution of generated script.

You may also include the desired file name for the generated script on the command-line after any specified options.

Installation


You can find the script here. To install it, just highlight the text and copy it into a text editor and save the resulting file. If you're feeling clever, you can directly write it to a file via the command-line. Highlight the text as before, open a terminal and enter the following command (assuming you have a bin directory in your home directory, otherwise adjust as needed):

cat > ~/bin/new_script

Paste the script into the terminal by clicking the middle mouse button and type Ctrl-d.

Once you have written the script, give it execute permissions like so:

chmod +x ~/bin/new_script 

Tuesday, May 8, 2012

Announcing LinuxCommand.org Version 3

Over the weekend I went live with a major revision to the LinuxCommand.org site. This update modernizes and improves the tutorials and simplifies the site to bring its content into sharper focus.


Both the Learning The Shell and Writing Shell Scripts tutorials have been updated and now incorporate some material from the book. The order of the lessons has also been slightly revised.

A few features of the old version of the site, such as the SuperMan Pages, Script Library, mailing lists, and RSS feed have been deprecated. If you have links to the old features, they will still work but they may go away in the future. I intend to add more links to external references (i.e. Further Reading sections to the lessons) and a few scripts to the new Resources page.

Please look it over and let me know about typos, and other screw-ups I may have missed. Thanks.

Next up: I am beginning work on the second edition of the book. If all goes well, you can expect to see that in the late summer.

Wednesday, February 18, 2009

Today's Site Updates

  • Thanks to sharp-eyed readers Dmitry Zhuravlev-Nevsky and Alexander Wireen, I have corrected a bunch of typos in the "Writing Shell Scripts" section of the tutorials.

Sunday, March 30, 2008

Today's Site Updates

  • Added some discussion to wss0150 to clarify use of parameter expansion in the final example. Also added a warning about a weakness with the error handling and the cd command.

Sunday, March 23, 2008

Today's Site Updates

  • Modified the discussion of wildcards in lts0050 to remove references to character ranges (which have been deprecated in the POSIX standard) and replace them with POSIX character classes.

Sunday, March 16, 2008

Today's Site Updates