Recent Notes

Displaying keyword search results 1 - 8
Created by magnum on October 22, 2012 19:48:03    Last update: October 22, 2012 19:48:03
execl takes the full path name of the command and variable length of arguments terminated by NULL: execl("/bin/ls", "/bin/ls", "-r", "-t", "-l", NULL... where the second argument is argv[0] , but can be any string! execlp will try to find the command from $PATH , so full path to command is not needed: execl("ls", "ls", "-r", "-t", "-l", NULL); execv is the equivalent of execl , except that the arguments are passed in as a NULL terminated array: char *args[] = {"/bin/ls", "-r", "-t", "-l", NULL ... execvp is the equivalent of execvl , excep that the arguments are passed in as a NULL terminated array: char *args[] = {"ls", "-r", "-t", "-l", NULL }; ...
Created by magnum on September 11, 2012 11:59:43    Last update: September 11, 2012 11:59:43
Exerpt from bash documentation. HISTORY EXPANSION The bash shell supports a history expansion feature that is similar to the history expansion in csh. This feature is enabled by default for interactive shells, and can be disabled using the +H option to the set builtin command. Non-interactive shells do not perform history expansion by default. History expansions introduce words from the history list into the input stream, making it easy to repeat commands, insert the arguments to a previous command into the current input line, or fix errors in previous commands quickly. History expansion is performed immediately after a complete line is read, before the shell breaks it into words. It takes place in two parts. The first is to determine which line from the history...
Created by torstello on January 06, 2012 07:32:25    Last update: January 06, 2012 07:32:25
rdoc documentation: usage(*args) Display usage information ... put something like this on top of your script: # == Synopsis # Blah blah blah. # ... method to display it def output_usage RDoc::usage('usa... bind it to the '-h' option via optionparser opts.on('-h', '--help') { output_help } ... source http://blog.toddwerth.com/entries/5
Created by freyo on August 17, 2011 12:29:46    Last update: August 17, 2011 12:29:46
In Android.mk , you can define LOCAL_JARJAR_RULES like this: LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.t... and in jarjar-rules.txt define a rule like this: rule org.bouncycastle.** com.android.@0 The build will change all org.bouncycastle to com.android.org.bouncycastle . Therefore, in your classes which are dependent on the library produced, the import statements should look like: import com.android.org.bouncycastle... Help for the jarjar utility (in prebuilt/common/jarjar/ ): $ java -jar jarjar-1.0rc8.jar Jar Jar Links - ...
Created by jinx on April 05, 2011 11:34:57    Last update: April 05, 2011 11:35:37
There are two variables you can use while writing command line applications with PHP - $argc and $argv : $argc is the number of arguments plus one (the name of the script running). $argv is an array containing the arguments, starting with the script name as number zero ( $argv[0] ). Example: #!/usr/bin/php <?php var_dump($argv); ?>
Created by Dr. Xi on February 28, 2011 12:29:19    Last update: February 28, 2011 12:30:40
The Unix shell passes these parameters to the shell script: Variable Meaning $* A single string representing all command line arguments separated by $IFS (internal field separator, usually a space) $@ A sequence of strings representing the command line arguments. $1,$2...$n $1 is the first argument, $2 is the second argument, and so on... $0 The name of the script itself. $# The number of arguments. Example shell script ( sharg.sh ): #!/bin/sh echo $# arguments passed to $0: $@ ... Output for ./sharg.sh "a b c d" : 1 arguments passed to ./sharg.sh: a b c d here ... Output for ./sharg.sh a "b c" d : 3 arguments passed to ./sharg.sh: a b c d here ...
Created by Dr. Xi on October 06, 2008 18:55:52    Last update: April 18, 2009 19:46:24
Command line arguments are passed to the python program in sys.argv , which is just a list. import sys for arg in sys.argv: prin...
Created by Dr. Xi on September 17, 2008 03:28:04    Last update: September 17, 2008 03:29:05
Starting with JDK1.5, Java allowed variable arguments (varargs) to methods. You use three dots after the final parameter type to indicate that variable number of arguments may be passed. Varargs can only be used in the final argument position. For example: static int sum (int ... numbers) { int total... Some examples from the Java API: java.text.MessageFormat: public static String format(String pattern, Object... java.lang.String: public static String format(String format, Object.... java.lang.ProcessBuilder: public ProcessBuilder(String... command)