Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

shopt

Make shopt change local to function

November 28, 2023 by Tarik

The function body can be any compound command, not just a group command ( {} ). Use a sub-shell: is_hello_world() ( shopt -s nocasematch [[ “$1” =~ “hello world” ]] )

Categories bash Tags bash, shopt Leave a comment

Why aliases in a non-interactive Bash shell do not work

April 8, 2023 by Tarik

The command shopt -s expand_aliases will allow alias expansion in non-interactive shells.

Categories bash Tags alias, bash, non-interactive, shopt Leave a comment

shopt command not found in .bashrc after shell updation

January 20, 2023 by Tarik

zsh uses env profile ~/.zshrc, not ~/.bashrc. so you need to append your env settings to .zshrc file and then source ~/.zshrc It must work. rbenv github link

Categories bash Tags bash, sh, shopt, zshrc Leave a comment

What expands to all files in current directory recursively?

January 4, 2023 by Tarik

This will work in Bash 4: ls -l {,**/}*.ext In order for the double-asterisk glob to work, the globstar option needs to be set (default: on): shopt -s globstar From man bash: globstar If set, the pattern ** used in a filename expansion con‐ text will match a files and zero or more directories and … Read more

Categories bash Tags bash, glob, shell, shopt, wildcard Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa