Saturday, September 28, 2024

Linux - console

 


    In Linux CLI it is possible to use build in function in bash and create by myself scripts. Build in funcction are very usefull. but more rewording are scripts especially writed yourselfs.

There are several ways to execute bash scripts.

- Run Bash Script using sh
    
    sh <script name> <arguments>
    
    Example:
    sh helloworld.sh

- Run Bash Script using bash

    bash <script name> <arguments>

    Example:
    bash helloworld.sh

- Run Bash Script using source

    source <path>*/<file name> <arguments>

    Path:
    ./file.sh - run in local directory
    /home/user/Documents/file.sh - run absolute path directory

    

    Example:
    source script.sh         - local path
    . script.sh                   - local path  
    
    /home/kb/script.sh     -absolute path


If necesarry right is needded use:
           chmod +x nazwa_pliku.sh



To be continue....

PS.

sh -  Bourne shell insterpreter
bash -  Bourne Again Shell 


To increase my user exprience in CLI, I choose to install ZSH and Starshipp. 
In the future my goal is to use Vim daily. 



No comments:

Post a Comment

K8s cluster - bash install

     In my homelab, I testes another method of installation of Kubernetes. Average time of installation of Kubernetes via Ansible was 15 min...