How to execute a windows batch command recursively?

For example, you have a rename command in a batch file, and you want to execute that file on the current directory and all sub-directories. Answer Suppose your batch is named something like myrename.cmd, then you can easily do the following: call myrename.cmd for /r /d %%x in (*) do ( pushd “%%x” call myrename.cmd … Read more

How to access mysql database using shell script?

Is there a way I can access MySQL database using shell script? want to do some selects and some inserts on multiple tables? It will be great if you can give some sample code as I am new to scripting. Answer This link seems to have the information you want. mysql -u user -p … Read more

How to run C++ application in Android SHELL

I want to run hello world written on C++ and compiled with Android toolchain 9, but I faced with issue: by default I have no permissions to launch it and I can’t change permissions using chmod`. I used Android 2.3.3 – Api Level 10 Application was compiled by cross compiler for API level 9 Procedure: … Read more

How to get Android system boot time

How can I get the absolute system boot time within the shell? i tried cat/proc/uptime, but this only returns the time since reboot. Answer It’s basically: java.lang.System.currentTimeMillis() – android.os.SystemClock.elapsedRealtime(); AttributionSource : Link , Question Author : Similitran , Answer Author : flx

If string contains in case statement

I’m looking to provide a case statement based on whether a substring is within a filename. Example Input mysql_dumps/tpmysqldump-tps_dev_russell_development-information_schema-2014-03-26.sql Code case $DUMPFILE in *”tpdata”*) database=”tpdata”;; *”tpmrbs”*) database=”tpmrbs”;; *”information_schema”*) database=”information_schema”;; *”performance_schema”*) database=”performance_schema”;; *) echo “INVALID FILE”;; esac Answer How do you initialize $DUMPFILE? If I run the following, the output is information_schema, which is what I … Read more