Site Map - skip to main content - dyslexic font - mobile - text - print

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.


Please support our Patrons

Our hosting is kindly provided by Josh from AnHonestHost.com. We would appreciate it if you could donate to help reduce his costs in funding the hosting. He is also accepting bitcoins to 1KsxJr9HtsdaUeU7yaV9bk9bQi21UPBtUq
Please also consider supporting the https://archive.org/donate/ who are now hosting our media files. Right now, a generous supporter will match your contributions 3-to-1. So your $5 donation results in $20 for the Internet Archive.

hpr2448 :: Useful Bash functions - part 3

A few more possibly useful Bash functions are discussed

<< First, < Previous, Latest >>

Host Image
Hosted by Dave Morriss on 2017-12-20 is flagged as Explicit and is released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. | Comments (6)

Part of the series: Bash Scripting

This is an open series in which Hacker Public Radio Listeners can share their Bash scripting knowledge and experience with the community. General programming topics and Bash commands are explored along with some tutorials for the complete novice.

Useful Bash functions - part 3

Overview

This is the third show about Bash functions. These are a little more advanced than in the earlier shows, and I thought I'd share them in case they are useful to anyone.

As before it would be interesting to receive feedback on these functions and would be great if other Bash users contributed ideas of their own.

Full Notes

Since the notes explaining this subject are long, they have been placed here.


Comments

Subscribe to the comments RSS feed.

Comment #1 posted on 2017-12-20T14:34:37Z by STLShawn

Fascinating

I have worked with DOS and windows for twenty five years now. My only nix experience was with phone systems and hotel systems with which I administered through step by step procedures. I am now starting to learn a bit more command line Linux as I have started playing with raspberry pi computers and switched a couple of laptops to Xubuntu and Mint XFCE.
As you probably guessed, a lot of the show went over my head, but it is fascinating to hear the possibilities for automation that are available if I could learn more of Bash commands. This series has been very helpful to me in developing a desire to learn more and find things that I could try to automate.
Thank you very much for your hard work.
Shawn

Comment #2 posted on 2017-12-20T17:12:26Z by Dave Morriss

Thanks Shawn

I'm glad you found it interesting, and hope this series proves to be useful to you. I plan to do more shows on Bash functions and Bash features in general in the future.

Dave

Comment #3 posted on 2017-12-21T12:55:18Z by Mike Ray

Bash shows

Keep it coming Dave.

I do a lot of bash programming, mostly because I work on the assumption that if I need to type the same complex command-line more than twice it should be a script, to cut down on typing, trying to remember stuff, and to cut down on errors.

I don't enjoy bash programming very much. Mostly because I hate not being able to use normal language constructs like:

result = function(argumments)

So the more tips and ideas from anybody else who faces the same questions the better

Comment #4 posted on 2017-12-21T19:04:13Z by Dave Morriss

Thanks Mike

Glad these are turning out to be useful.

I have always been fascinated by what I guess can be called 'command languages'. I have worked with the GEORGE operating system that had a fairly basic one, and VMS, which which had DCL (Digital Command Language), which grew to be fairly sophisticated during my time using it. However, in comparison, I find Bash to be considerably more sophisticated. Still not a true language with features like those you describe, but nevertheless worth working with I think.

It's this that motivates me to describe what can be done with Bash, and I amuse myself trying to do things that stretch my imagination a bit :-)

Dave

Comment #5 posted on 2017-12-29T16:03:41Z by Mike Ray

BASH_REMATCH

How about some shows about the various built-in variables? I have made use of BASH_REMATCH (dollar sign excluded because I assume it might break something), but I assume there are more I have missed.

Comment #6 posted on 2017-12-29T16:39:39Z by Dave Morriss

Re: BASH_REMATCH

Great suggestion.

On my list of future Bash topics I have Regular Expressions, quite near the top. That episode would include BASH_REMATCH of course.

I have mentioned one or two of the other Bash variables in passing such as FUNCNAME , but there are many more.

Thanks for the feedback.

By the way, with our new comment system we strip HTML but take measures to try to ensure all other ASCII characters pass through unhindered. So dollar signs ($) shouldn't be a problem.

<< First, < Previous, Latest >>

Leave Comment

Note to Verbose Commenters
If you can't fit everything you want to say in the comment below then you really should record a response show instead.

Note to Spammers
All comments are moderated. All links are checked by humans. We strip out all html. Feel free to
record a show about yourself, or your industry, or any other topic we may find interesting. We also check shows for spam :).

Provide feedback
Your Name/Handle:
Title:
Comment:
Anti Spam Question: What does the P in HPR stand for ?
Are you a spammer →
Who hosted this show →
What does HPR mean to you ?