I'm trying to write a shell script that, when run, will set some environment variables that will stay set in the caller's shell.
Ccna final exam - java, php, javascript, ios, cshap all in one. This is a collaboratively edited question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
Tuesday, June 5, 2012
Can a shell script set environment variables of the calling shell?
BASH: Possible to abort shell script if any command returns a non-zero value?
I have a Bash shell script that invokes a number of commands. I would like to have the shell script automatically exit with a return value of 1 if any of the commands return a non-zero value.
Friday, June 1, 2012
unix shell script find out which directory the script file resides?
Basically I need to run the script with paths related to the shell script file location, how can I change the current directory to the same directory as where the script file resides?
Wednesday, May 30, 2012
Best way to kill all child processes
I basically want to kill a whole process tree. What is the best way to do this using any common scripting languages. I am looking for a simple solution.
Sunday, May 27, 2012
What Linux/Unix commands are outdated and have powerful alternatives?
Today I discovered you can make less act like tail -f .
Monday, May 21, 2012
Why doesn"t "cd' work in a bash shell script?
I'm trying to write a small script to change the current directory to my project directory:
In the bash script how do I know the script file name?
How can I determine the name of the bash script file inside the script itself?
How do I prompt for input in a Linux shell script?
I want to pause input in a shell script, and prompt the user for choices. The standard 'Yes, No, or Cancel' type question. How do I accomplish this at a typical bash prompt?
Sunday, May 20, 2012
How do I iterate over a range of numbers in bash?
How do I iterate over a range of numbers in bash when the range is given by a variable?
Friday, May 18, 2012
How to count all the lines of code in a directory recursively?
We've got a PHP application and want to count all the lines of code under a specific directory and its subdirectories. We don't need to ignore comments, as we're just trying to get a rough idea.