Tag Info

New answers tagged

2

In addition to @Michael Homer's answer, you can use bash eval function: PARMS='-rvu' PARMS+=" --delete --exclude='.git'" echo "$PARMS" eval "rsync ${PARMS} . "'"${TARGET}"'


11

There is a difference between: PARMS+="... --exclude='.git'" and ... --exclude='.git' In the first, the single quotes are inside quotes themselves, so they are literally present in the substituted text given to rsync as arguments. rsync gets an argument whose value is --exclude='.git'. In the second, the single quotes are interpreted by the shell at ...


0

your script would look something like: #!/bin/bash /path/to/timidity "$1" But, can you right-click the midi file and "open with" timidity instead? Seems simpler.


3

If you are using the GNU tools, the following should also work: find /some/path -type f -name file.pl -size +10M -print0 | xargs -0 -n 1 -r perl /my/script.pl Explanation: The option -print0 causes GNU find to separate the file names with \0 bytes. Since \0 bytes cannot be part of the file name, this uniquely separates the file names. The option -0 ...


5

That's what the -exec predicate is for: find /some/path -type f -name file.pl -size +10M -exec perl /my/script.pl {} \; If you do want to have your shell run the commands based on the output of find, then that will have to be bash/zsh specific if you want to be reliable as in: zsh: IFS=$'\0' for f ($(find /some/path -type f -name file.pl -size +10M ...


-3

This should do it for path in `find /some/path -type f -name file.pl -size +10M`; do perl /my/script.pl $path ;done


2

The script expects an argument when it's executed. This argument is the directory where *.apk resides. The argument is called in the script by cd $1 line, this is how arguments are called in shell scripting. Please try to rerun your script in the following manner: sh cert.sh </path/where/apks/reside> and see if that resolves your issue? Also, ...


0

The script is executing fine. It would not produce all of those errors if it weren't. You have the following issues: 1) There aren't any files with the suffix .apk in your ...\test1 directory and your script has not been written to handle this kind of error. Ditto for *.odex. 2_ The script expects to be able to create the directories none and other, but ...


4

Alternate solution: use the -e option, as suggested by the man page ("to protect a pattern beginning with a hyphen"): fgrep -e --help


9

I believe you can use fgrep -- --help to achieve this. The man page mentions fgrep -e --help Quote from http://www.openbsd.org/cgi-bin/man.cgi?query=grep: -e pattern Specify a pattern used during the search of the input: an input line is selected if it matches any of the specified patterns. This option is most useful when multiple -e ...



Top 50 recent answers are included