Posts

Showing posts with the label Bash

New blog domain: kula.blog

It's still work in progress but new posts will be published on  https://kula.blog/ Thanks to 11ty base blog RSS is working from the start so it should be easy to add to your reader if you still use any :) If now then I hope you can sign up to the newsletter where I'll be publishing new posts and interesting articles to it from time to time. Please use  kula.blog  from now on.

5 things I learned from "How to train your BASH" by Marcin Stożek "Perk"

Image
Today I've watched a presentation by Marcin Stożek called  How to train your BASH  and wanted to remember the most interesting points for later. 1. It's best if you follow a style guide There seems to be only one though  Google Shell Style Guide . 2. You can set Bash to  "strict mode"   It sets more human-friendly defaults and makes sure you won't miss any errors in your scripts. #!/bin/bash set -euo pipefail IFS=$'\n\t' 3. Shellcheck Turns out there is a tool called  shellcheck  that can help you write scripts that you intended to write. Best thing is that it explains what's wrong and gives you suggestions on how you can fix it. 4. You can enable 'debug mode' when running your script Just pass " -x " to the script eg.  >  bash -x ./my_script.sh 5. Use Pure Bash No one wants to see weird errors when running the script on a new server so it's best if you avoid using external programs in yo...

Bashrc vs BashProfile

Good post about configuring .bash_profile and .bashrc files. http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html The result is: source .bashrc from .bash_profile because .bashrc runs for every session.

Vi, Python and Bash in learning queue

From a month I doesn't have a Windows System even installed, and after finishing some books I want to learn more about using Linux and programming in Linux. I think that for a beggining I want to : Learn  Vi , Learn  Bash , and more about Linux  terminals , and Linux System as... System ;) Learn  Python . I have started reading about Python some time ago at:  http://pl.wikibooks.org/wiki/Zanurkuj_w_Pythonie/  in Polish to get it easier, but after That I think about reading a whole book in English. Anyway I started from Python, but now I think that while learning Python I want to use Linux Editor, I have to choose from Vi and emacs but Vi wins for me, without  a reason - I just fight with it a couples of times, and at least know basics :) It is good idea as I think to write Python in Vi instead of NetBeans, gedit(good with addons), or Eclipse. I can't use them in terminal ... Generally I must learn more about Linux, I use only some basics command and ...