LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-22-2019, 01:57 PM   #1
grigory
Member
 
Registered: Oct 2015
Posts: 133

Rep: Reputation: Disabled
Differences in BASH in last decade


Hello!
I've found onine is pretty decent video tutorial about BASH. But it's dated around 2010. I think Ubuntu 10.10 or so... You think I can still learn today by using that old tutorial or there're changes in BASH in last years that render that course obsolete?
 
Old 09-22-2019, 02:42 PM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
well if it is a video and free to watch etc.. I am sure you can pick up some good information on it. I and a lot of others are still using https://www.tldp.org/LDP/abs/html/index.html dated 10 Mar 2014
 
Old 09-22-2019, 02:49 PM   #3
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
don't forget
https://mywiki.wooledge.org/BashGuide


and if you link the video we could provide feedback on it
 
Old 09-22-2019, 04:44 PM   #4
grigory
Member
 
Registered: Oct 2015
Posts: 133

Original Poster
Rep: Reputation: Disabled
Thank you all... Well, that video course isn't even in English :-)
 
Old 09-22-2019, 04:56 PM   #5
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by grigory View Post
Thank you all... Well, that video course isn't even in English :-)
what about sub titles? bash code in the video
or
what you never watched a Bollywood video and tried to figure it out?

YouTube too would be a good source if you like having to wait for the person to get to the point, instead of just finding it in print then getting the information you need and cut out all of that chit chat between it, like in the videos.like them links that were posted.

Last edited by BW-userx; 09-22-2019 at 04:58 PM.
 
Old 09-23-2019, 02:39 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
I'm pretty sure bash is backwards compatible; a 10-year-old script should, nay MUST still work on modern bash versions.
 
Old 09-23-2019, 06:20 AM   #7
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by ondoho View Post
I'm pretty sure bash is backwards compatible; a 10-year-old script should, nay MUST still work on modern bash versions.
Actually, normally a Bourne cq Posix script should be working still in bash (as long as you use #!/bin/sh as it's first line).
 
Old 09-23-2019, 02:40 PM   #8
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,998

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
My guess would be that bash has changed very little in it's use from a new user point of view.
The programs versus commands that one tends to use in bash could have changed a lot.
I'd get a current book on bash if you insist on learning it to be an expert user. Knowing historic usage won't help you if you need advanced tasks in that shell.

If one used bash for advanced tasks they'd need to monitor and learn changes such as found here.
https://github.com/bminor/bash/blob/master/CHANGES
You'll notice that most of the changes are not really use level changes.

With all of linux and it's programs each version and or build can be very different.

Last edited by jefro; 09-23-2019 at 02:53 PM.
 
Old 09-23-2019, 03:15 PM   #9
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
bash itself may or may not have changed much in that time but there are newer ways of doing things that many of us old UNIX ksh folks were slow to adopt.

For example using $() around a command line to use its output as input for something else instead ``.

e.g. both the following work:
list=$(ls -l |awk '{print $NF}')

list=`ls -l |awk '{print $NF}'`

But these days the first syntax is preferred and has benefits over the second (older) syntax. For one thing it is much easier to nest $() within another $() than it is to do it with ``.

P.S.
Before anyone says it: I know just "ls" will give me only the file names so I wouldn't need to do ls -l and pipe into awk - I'm just using it as an example of command line encapsulation.
 
Old 09-23-2019, 08:26 PM   #10
grigory
Member
 
Registered: Oct 2015
Posts: 133

Original Poster
Rep: Reputation: Disabled
Thank you all for taking your time to reply! No, I don't have plans to become an expert in bash. But you never know..
 
Old 09-23-2019, 09:59 PM   #11
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,998

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
If you ever need to know how to write/form some shell command then I'd like to point out that some members at LQ seem to be pretty amazing at the task. MensaWater offers a peek.
 
Old 09-24-2019, 01:43 AM   #12
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
On a related note, what are the main differences (*) between the bash version MacOS ships with (3.2 iirc), and a modern version?

(*) For a bash learner learning on MacOS, and maybe looking up things online.
 
Old 09-24-2019, 04:05 AM   #13
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
from bash manpage with regards to shopts
Quote:
compat32
If set, bash changes its behavior to that of version 3.2 with respect to
locale-specific string comparison when using the [[ conditional command's <
and > operators (see previous item) and the effect of interrupting a com-
mand list. Bash versions 3.2 and earlier continue with the next command in
the list after one terminates due to an interrupt.
compat40
If set, bash changes its behavior to that of version 4.0 with respect to
locale-specific string comparison when using the [[ conditional command's <
and > operators (see description of compat31) and the effect of interrupt-
ing a command list. Bash versions 4.0 and later interrupt the list as if
the shell received the interrupt; previous versions continue with the next
command in the list.
compat41
If set, bash, when in posix mode, treats a single quote in a double-quoted
parameter expansion as a special character. The single quotes must match
(an even number) and the characters between the single quotes are consid-
ered quoted. This is the behavior of posix mode through version 4.1. The
default bash behavior remains as in previous versions.
compat42
If set, bash does not process the replacement string in the pattern substi-
tution word expansion using quote removal.
compat43
If set, bash does not print a warning message if an attempt is made to use
a quoted compound array assignment as an argument to declare, makes word
expansion errors non-fatal errors that cause the current command to fail
(the default behavior is to make them fatal errors that cause the shell to
exit), and does not reset the loop state when a shell function is executed
(this allows break or continue in a shell function to affect loops in the
caller's context).
compat44
If set, bash saves the positional parameters to BASH_ARGV and BASH_ARGC be-
fore they are used, regardless of whether or not extended debugging mode is
enabled.
 
Old 09-25-2019, 12:21 PM   #14
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by Firerat View Post
compat32
good to know.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Get first day of last month and last day of last month in bash xowl Linux - Software 18 02-09-2017 09:49 AM
LXer: A catchup of technologies in the last decade LXer Syndicated Linux News 0 10-13-2014 05:45 PM
LXer: The 10 Biggest Tech Failures of the Last Decade LXer Syndicated Linux News 0 05-15-2009 01:01 PM
LXer: A Decade of Linux & Increasingly Stronger LXer Syndicated Linux News 0 03-15-2007 05:01 AM
LXer: Celebrate the XML Decade LXer Syndicated Linux News 0 11-17-2006 05:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration