Top Tweets for #masteringbash
Last month has been highly fruitful for the books I've finished. Yesterday my #Shell marathon inspired by the @pragprog book had ended. It is a year now since I've started and it's almost 1000 pages in total read.
#MasteringBash
Redirection capabilities are rather powerful in #Bash. Notice this little | after for and have a look at the result.
#Shell #Linux #MasteringBash

If you want to discover on which level of nesting of #Bash subshells you are at the moment, you can use the $BASH_SUBSHELL variable.
#Shell #Linux #MasteringBash
It turns out that my yesterday's thoughts were close to right. () spawns new #Bash not depending on placing running command to the background.
#Shell #Linux #MasteringBash
Using () creates a separate subshell for (sleep 100 &) thus not showing it in the results of jobs command. Do () create subshell every time when used? Like (echo 1) or something like that?
#Shell #Linux #MasteringBash #Bash

Handling multiple arguments in #Bash is convenient using following construction.
#Shell #Linux #MasteringBash

#MasteringBash has switched to integration with the Slack messenger, and this one seems interesting. Do not know if Slack hooks are an elegant solution but they seem to be one at the first sight.
#Shell #Linux #Bash
Just discovered an interesting concept of anonymous function in #Bash. Wanted to try it out but it appeared that Bash doesn't treat an anonymous function as function!๐ฎ Removing local keyword worked fine.
#MasteringBash #Shell #Linux


Has anybody tried using ;& and ;;& terminators for case statement in #Bash on macOS? I have version 4.4 installed so they should be supported, but syntax error seems to appear anyway.๐ค
#MasteringBash #Shell #Linux
In #Bash language you can return to the previous working directory using cd -. Also, there are two ways to discover the path to the last working directory:
echo $OLDPWD
echo ~-
#MasteringBash #Shell #Linux
When #JavaScript uses \b in a regular expression, it means any word boundary. \< and \> in #Bash mean start and end of the word respectively.
#MasteringBash #Shell #Linux
Good tip from #MasteringBash: Whenever you test a variable, quote it! Unquoted variables can lead to weird results, especially when dealing with null values.
Shellcheck helps to discover this kind of problem.
#Bash #Shell #Linux
#Bash is the first language I try where spaces matter so much. First two ifs have comparison inside [], and the last has an assignment.
#MasteringBash #Shell #Linux
![turbobureaucrat's tweet photo. #Bash is the first language I try where spaces matter so much. First two ifs have comparison inside [], and the last has an assignment.
#MasteringBash #Shell #Linux https://t.co/syqMwHFIoP](https://pbs.twimg.com/media/DkEuWLhW0AEx8sx.png)
Using man bash is not a very convenient way to find out information about builtins in #Bash. Do you a way that is better?
#MasteringBash #Shell #Linux
Also, I find ranges rather handy in #Bash. You can do one using following notations: {start..end..step} (bash --version more than 4.0) or {start..end} (bash --version more than 3.0).
echo hi_{1..3} โ hi_1 hi_2 hi_3
#MasteringBash #Shell #Linux
In #Bash, there is an interesting analog to && operation from #JavaScript. The default value will be used only if the original value is available.
Syntax: ${<variable>:+<default value>} or ${<variable>+<default value>}.
#MasteringBash #Shell #Linux

Trends for you
Most Popular Users

Elon Musk 
@elonmusk
241.2M followers

Barack Obama 
@barackobama
119.1M followers

Cristiano Ronaldo 
@cristiano
112.8M followers

Donald J. Trump 
@realdonaldtrump
111.8M followers

Narendra Modi 
@narendramodi
107.1M followers

Rihanna 
@rihanna
98.3M followers

NASA 
@nasa
92.3M followers

Justin Bieber 
@justinbieber
91.4M followers

KATY PERRY 
@katyperry
89M followers

Taylor Swift 
@taylorswift13
82.9M followers

Lady Gaga 
@ladygaga
74.4M followers

Virat Kohli 
@imvkohli
71.9M followers

Kim Kardashian 
@kimkardashian
70.4M followers

YouTube 
@youtube
68.8M followers

Neymar Jr 
@neymarjr
64.8M followers

Bill Gates 
@billgates
64.6M followers

The Ellen Show
@theellenshow
62.4M followers

Selena Gomez 
@selenagomez
62.1M followers

CNN 
@cnn
61.8M followers

X 
@x
60.8M followers





