How to echo shell commands as they are executed?

In a shell script, how do I echo all shell commands called and expand any variable names? For example, given the fo...

Using the RUN instruction in a Dockerfile with 'source' does not work?

I have a Dockerfile that I am putting together to install a vanilla python environment (into which I will be install...

Shell - Write variable contents to a file?

I would like to copy the contents of a variable (here called var) into a file. The name of the file is stored in an...

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? ...

Reload .profile in bash shell script (in unix)??

I'm new to bash shell scripting, and have come across a challenge. I know I can reload my ".profile" file by just do...

How to check if a variable is set in Bash??

How do I know if a variable is set in Bash? For example, how do I check if the user gave the first parameter to a f...

How to use crontab in Android??

I can't find answer to my question: Is it possible to run crontab to reboot Android using busybox (or other means) ...

Rounding up float point numbers bash?

Ok, so I'm trying to round up an input of 17.92857, so that it gets an input of 17.929 in bash. My code so far is: ...

Remove ^H and ^M characters from a file using Linux shell scripting?

How do I remove ^H and ^M characters from a file using Linux shell scripting? ^[[0^H ^H^H ^H^H ^H^H ^H^H ^H^H ^H^H ...

How to reload .bash_profile from the command line??

How can I reload .bash_profile from the command line? I can get the shell to recognize changes to .bash_prof...

.sh File Not Found?

I'm trying to execute test.sh on terminal. My test.sh is in the /Home/monty folder and I made it executable: chmod...

How come npm install doesn't work on git bash?

I have git bash open and I type in npm install and then it returns: bash: npm command not found I don't understan...

Piping stdin to R?

I am having trouble piping stdin to an R script. Here is my toy script test.R: #!/usr/bin/env Rscript while(length...

PHP shell_exec() vs exec()?

I'm struggling to understand the difference between shell_exec() and exec()... I've always used exec() to execute s...