Using getopts to process long and short command line options?

I wish to have long and short forms of command line options invoked using my shell script. I know that getopts can ...

*Non-interactive* SQLite3 usage from bash script?

I see plenty of examples showing how to use the sqlite3 interactive shell, e.g.: $ sqlite3 $ sqlite3> SELECT * f...

Github permission denied: ssh add agent has no identities?

This is my first time accessing GitHub and I'm not experienced using a console. I am on a MacBook using Bash. When I...

Bash script: bad interpreter?

Question: I get this error message: export: bad interpreter: No such file or directory when I execute this bas...

What does 'cd -' stand for??

In a bash shell script today I noticed the below command at the end of the script. I know what is cd but I am unawar...

Get the username and the process ID of a process in bash?

I am writing a bash script where I need to find out the userID of a process. For an example let the process be bash ...

How can I remount my Android/system as read-write in a bash script using adb??

For info adb remount returns "remount failed: Operation not permitted" adb shell 'su -c mount -o rw,remount /...

How to call one shell script from another shell script??

I have two shell scripts, a.sh and b.sh. How can I call b.sh from within the shell script a.sh? ...

What is the purpose of the : (colon) GNU Bash builtin??

What is the purpose of a command that does nothing, being little more than a comment leader, but is actually a shell...

How to install Homebrew on OS X??

I'm trying to install Homebrew on OS X. According to the Homebrew site I should type brew install wget and all I...

How to change the output color of echo in Linux?

I am trying to print a text in the terminal using echo command. I want to print the text in a red color. How can I...

Shell script not running, command not found?

I am very, very new to UNIX programming (running on MacOSX Mountain Lion via Terminal). I've been learning the basic...