Bash Equivalent of the ifmain Pattern in Python

Posted on Jul 28, 2022 in Computer Science • Tagged with Computer Science, programming, Shell, Bash, ifmain, Python, module, script, function, import, source

Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives.

Fish Shell is preferred to Bash/Zsh. The following content is for Bash/Zsh only.

#!/usr/bin/env bash

function install_icon.usage() {
    cat << EOF
NAME
    /scripts/sys …

Continue reading

Tips on Conda

Posted on Apr 22, 2018 in Computer Science • Tagged with programming, Python, conda, tips, Anaconda Python

Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives.

  1. conda and executables installed by conda might not be able to run by sudo directly. If this happends, use the full path of the executable or add …


Continue reading

Tips on Gitpod

Posted on Feb 20, 2019 in Software • Tagged with Software, programming, GitPod, GitHub, Theia IDE

Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives.

  1. GitPod is a great web IDE for GitHub repositories. It supports both IDE and terminal environment via Docker, so a whole lot can be done if you …


Continue reading

Extended Globbing in Bash

Posted on Jun 04, 2022 in Computer Science • Tagged with Computer Science, programming, bash, shell, glob, globbing, extended

Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives.

Fish Shell is preferred to Bash/Zsh. The following content is for Bash/Zsh only.

Enable Extended Globbing

shopt -s extglob

Or you can run bash with …


Continue reading

Tips on tmux

Posted on Oct 22, 2013 in Software • Tagged with tips, tmux, software, remote, screen, terminal

Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives.

** Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives. **

Zellij is a better …


Continue reading

Regular Expression in Bash

Posted on Apr 28, 2019 in Computer Science • Tagged with programming, Bash, regular expression, regex

Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives.

Fish Shell is preferred to Bash/Zsh. The following content is for Bash/Zsh only.

It is suggested that you use Python script instead of Shell script …


Continue reading