Giter VIP home page Giter VIP logo

bash-handbook's Introduction

SWUbanner

bash-handbook's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bash-handbook's Issues

Error when running bash-handbook

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)          

IFS is confusing...

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.

  1. I think the default value of IFS is space, tab, and newline.
  2. It might be helpful to link to Word splitting in the Bash manual in case readers need the details.

superflous semicolons

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

Show [[ <conditional> ]] instead of [ <conditional> ]

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.

Translation Request: German/Deutsch

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.

Consider to include readarray and map key value arrays

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]}

New Command: Read

Can i work on including read command to this guide to read data from stdin

Small typo

At readme. In example with shell expansion, variable now missing $. ;-)

Add Chinese translation

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!

enhancement

Brace expansion

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

Translation Request: Spanish

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?

Thanks!!

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!

{folder1,folder2,folder3} doesn't work in sh

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}

Add note about whitespace when introducing `[ ]` and `[[ ]]`

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" ]]

TypeError: Object Variable has no method 'codePointAt'

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.

Wrong exit code variable

The exit code of the last executed command is not saved in #?, but $?. #? isn't even a variable, it's a comment.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.