denysdovhan / bash-handbook Goto Github PK
View Code? Open in Web Editor NEW:book: For those who wanna learn Bash
Home Page: https://git.io/bash-handbook
:book: For those who wanna learn Bash
Home Page: https://git.io/bash-handbook
The select
control flow example should probably include support for how to handle unrecognized values.
I get the error below when I run
C:\Users\Raphi\AppData\Roaming\npm\node_modules\bash-handbook\node_modules\msee\lib\msee.js:312
var code = str.codePointAt(i);
^
TypeError: Object Variable has no method 'codePointAt'
at getStringWidth (C:\Users\Raphi\AppData\Roaming\npm\node_modules\bash-handbook\node_modules\msee\li
b\msee.js:312:24)
at C:\Users\Raphi\AppData\Roaming\npm\node_modules\bash-handbook\node_modules\msee\node_modules\text-
table\index.js:33:21
at Array.forEach (native)
at forEach (C:\Users\Raphi\AppData\Roaming\npm\node_modules\bash-handbook\node_modules\msee\node_modu
les\text-table\index.js:73:31)
at C:\Users\Raphi\AppData\Roaming\npm\node_modules\bash-handbook\node_modules\msee\node_modules\text-
table\index.js:32:9
at Array.reduce (native)
at reduce (C:\Users\Raphi\AppData\Roaming\npm\node_modules\bash-handbook\node_modules\msee\node_modul
es\text-table\index.js:63:30)
at module.exports (C:\Users\Raphi\AppData\Roaming\npm\node_modules\bash-handbook\node_modules\msee\no
de_modules\text-table\index.js:31:17)
at tableFormat (C:\Users\Raphi\AppData\Roaming\npm\node_modules\bash-handbook\node_modules\msee\lib\m
see.js:294:12)
at processToken (C:\Users\Raphi\AppData\Roaming\npm\node_modules\bash-handbook\node_modules\msee\lib\
msee.js:188:23)
I've always struggled with understanding the particulars of IFS and word splitting, so I'd like to try to give beginners as much help with this as possible.
In the if
section many semicolons in the multiline examples are not required
Example:
# Single-line
if [[ 1 -eq 1 ]]; then echo "true"; fi;
# Multi-line
if [[ 1 -eq 1 ]]; then
echo "true"; # <- not required
fi; # <- not required
I am able to translate this language yes
I am able to translate this language YES!!
😄
I am able to translate this language [yes]
In the table where conditionals are explained, [ <condional> ]
is shown, but on the top [[ <conditional> ]]
is favored.
Stick to [[ <conditional> ]]
, both are valid, but single brackets behave very differently to double brackets.
Double brackets are a bash feature, and not required by POSIX, while single brackets are required by the POSIX standard.
I am able to translate this language! I don't know how much I would be able to translate in a given time span though because university, private projects and procrastination.
Hello,I`m kazu.
How about translations to Japanese?
сс/ @bucaran, @andrepolischuk
After #19, “Tables of contents” is broken.
I am able to translate this language [yes]
First all, congratulations is a great bash-handbook! I suggest to include examples with readarray, to convert any command linux to array like this:
declare -a array
readarray -t array <<< "$(snmpwalk -v "${VERSION}" -c "${COMMUNITY}" -O n ${DEVICE} ${OID})"
Or include some examples about map arrays. Here an example:
$ declare -A mapkeys
$ mapkeys=( [a]=one [b]=two [c]=three )
$ echo ${mapkeys[a]}
Can i work on including read
command to this guide to read data from stdin
I am able to translate this language, yes.
At readme. In example with shell expansion, variable now missing $. ;-)
I am able to translate this language yes
I am able to translate this language [yes]
I have translated this handbook(based on V2.4.0) to Chinese these days.
It’s in my own repo for now. I plan to let others review the translation first, after that I’ll create a pull request. I myself have also read it several times and seems fine.
Thanks you for the great handbook!
Thank you for your excellent work :)
Please consider adding the read command to this handbook to accept input from users into shell variables. A simple tool to create interactive shell scripts.
echo {00..8..2} # 00 02 04 06 08
U can clarify the rule here as it's {00..8..2}
represents {start..end..steps}
like $ echo {0..10..3}
output: 0 3 6 9
I am able to translate this language [yes/no]
I am able to translate this language [yes]
I am able to translate this language [yes/no]
The linked serverfault.com answer is subject to change or be deleted and, if the current answer is to remain the reference, it should be made stable via archive.org.
I'll submit a PR but here's the archive.org capture I just created: https://web.archive.org/web/20240205165239/https://serverfault.com/questions/52034/what-is-the-difference-between-double-and-single-square-brackets-in-bash/52050#52050
How about translations to other languages? Personally, I can translate to Ukrainian and Russian.
Actually, this book is extended tranlation of my «Конспект по Bash» article on Ukrainian.
сс/ @bucaran, @andrepolischuk
Patrick Mueller (@pmuellr) build awesome pdf verion for bash-handbook:
useful looking Node Packaged Manuscript - "bash-handbook" - as a tablet-friendly PDF: https://t.co/epiRsmRyI8
— Patrick Mueller (@pmuellr) January 28, 2016
We could use markdown-pdf and Travis hooks for building and pushing bash-handbook.pdf
into gh-pages
.
@bucaran, @andrepolischuk what do you think?
I am able to translate this language [yes]
I am able to translate this language [yes/no]
Darwin manpage is broken link.
Add update notifier to handbook.
Concatenate message with book content.
Actually I don't how to use grep or less.
I am able to translate this language: yes.
I have basic Bash proficiency and I'm currently using learnyoubash to practice/learn. I can volunteer to translate the bash-handbook to Spanish, what's the process to contribute translations?
I'll be going through the handbook this week and translating it as I go.
Thanks for creating this handbook @denysdovhan ✨ 👍 This is a great resource!
I have a few minor corrections and suggested improvements to propose--look for those in pull requests/issues.
Thanks again!
thanks for this great handbook.
i have a question that is
i want to make many dirs in a folder
but what i get is just folder with a longname like this
{client,server,collections,lib,public}
#!/bin/bash
# learn shell script
$PROJECTNAME=$1
mkdir -p $PROJECTNAME/{client,server,collections,lib,public}
I think it would be valuable to explicitly talk about whitespace requirements in [ ]
and [[ ]]
conditionals--this tripped me up when learning Bash and I know it's a pain point for a lot of developers.
The way I like to think about it is that [
and [[
are commands/builtins (like echo
, etc), as opposed to being part of Bash syntax. For this reason, the command name and each of its arguments must be separated by whitespace:
[[ -n "$1" ]]
# not
[[-n"$1"]]
[[-n "$1"]]
[[ -n"$1" ]]
As a user of Linux systems, I have been looking for a platform that can help me better understand and use bash scripts.
Can you take the time to learn about our projects?
Hello, just installed [email protected] and run into the following issue when tried to run bash-handbook
:
/usr/lib/node_modules/bash-handbook/node_modules/msee/lib/msee.js:312
var code = str.codePointAt(i);
^
TypeError: Object Variable has no method 'codePointAt'
at getStringWidth (/usr/lib/node_modules/bash-handbook/node_modules/msee/lib/msee.js:312:24)
at /usr/lib/node_modules/bash-handbook/node_modules/msee/node_modules/text-table/index.js:33:21
at Array.forEach (native)
at forEach (/usr/lib/node_modules/bash-handbook/node_modules/msee/node_modules/text-table/index.js:73:31)
at /usr/lib/node_modules/bash-handbook/node_modules/msee/node_modules/text-table/index.js:32:9
at Array.reduce (native)
at reduce (/usr/lib/node_modules/bash-handbook/node_modules/msee/node_modules/text-table/index.js:63:30)
at module.exports (/usr/lib/node_modules/bash-handbook/node_modules/msee/node_modules/text-table/index.js:31:17)
at tableFormat (/usr/lib/node_modules/bash-handbook/node_modules/msee/lib/msee.js:294:12)
at processToken (/usr/lib/node_modules/bash-handbook/node_modules/msee/lib/msee.js:188:23)
Please let me know how can I resolve this issue.
Thank you.
I am able to translate this language [yes/no]
I am able to translate this language [yes/no] Yes.
I am able to translate this language [yes]
The exit code of the last executed command is not saved in #?
, but $?
. #?
isn't even a variable, it's a comment.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.