What is export for? What is the difference between:
export name=value
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.
What is export for? What is the difference between:
export name=value
I have a process in linux that's getting a segmentation fault. How can I tell it to generate a core dump when it fails?
To redirect stdout in bash, overwriting file
cmd > file.txt
To redirect stdout in bash, appending to file
I have the below command line argument which will print the output of aaa.sh to the screen while also writing stdout to bbb.out; however I would also like to write stderr to a file ccc.out. Any suggestions on how to modify the below piece? Thanks!
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.
I'd like to be able to use the result of the last executed command in a subsequent command. For example,
Is it possible to pipe to/from the clipboard in bash? Whether it's piping to/from a device handle or using an auxiliary application, I can't find anything.
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.
Is it possible to check a bash script syntax without executing it?
When I grep my Subversion working copy directory, the results include a lot of files from the .svn directories. Is it possible to recursively grep a directory, but exclude all results from .svn directories?
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?
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.
I've used the following script to see if a file exists:
How can I determine the name of the bash script file inside the script itself?
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?
I often use the find command to search through source code, delete files, whatever. Annoyingly, because Subversion stores duplicates of each file in its .svn/text-base/ directories my simple searches end up getting lots of duplicate results. For example, I want to recursively search for uint in multiple messages.h and messages.cpp files:
How do I iterate over a range of numbers in bash when the range is given by a variable?
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.
How do I split a string based on a delimiter in Bash?
i have this script:
#!/bin/bash
if [[ -z "$1" ]] ; then
echo "Class is required"
exit 1;
fi
if [[ -z "$2" ]] ; then
package="Default"
else
package=$2;
fi
echo "<?php
/**
* $1.class.php
*
* Vcard class file.
* @name Project
* @author Author
* @link http://www.domain.com
* @copyright Copyright © 2011
* @package $package
* @version 1.0
*/
/**
* The main $1 class
* @package $package
*/
class $1 {
/**
* Constructor setup.
*/
public function __construct() {
}
/**
* Destructor setup.
*/
public function __destruct() {
}
}
" > $1.class.php
php -l $1.class.php
echo "Done";