Tag Info

New answers tagged

0

one line: cd $(dirname $([ -L $0 ] && readlink -f $0 || echo $0))


2

You're using a makefile. Makefiles aren't scripts, each line is executed in a new shell. Meaning when you change the environment in line (such as cd), that change is not propagated to the next line. The solution is that when you want to preserve the environment between commands, you run all the commands in the same line. All the commands will then be ...


0

A script is run in a subshell, which means it has its own $PWD. Once it exits you get the "old" $PWD. If you want to keep the $PWD you need to source (aka. .) the script instead of running it. This won't work in a Makefile, however, because each command is run in a separate subshell: $ pwd /home/user $ cat test.sh cd / $ cat Makefile test: . ./test.sh ...


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


0

As answered by gnouc, - has its own meaning in cd. However, you can replicate the behavior of - in other programs using ~-. For example: cd /etc cd / ls ~- #lists the contents of the /etc directory vim ~-/fstab #opens the file /etc/fstab in vim


0

Adding my two cents here. I use '-' to tell the ps2pdf tool to read from standard input, as several people have suggested previously: man -t ls | ps2pdf - ls.pdf The above one-liner creates a pdf version of the man page for ls in the current directory. Hope someone finds it useful :).



Top 50 recent answers are included