Executing commands with ‘find’
To executes commands with ‘find’ use the ‘-exec’ option. Example:
find /var - type f -name "*.log" -mtime -2 -exec ls -als {} ;
English translation: Find files in /var that end with “.log” and have been modified in the past two days. Run “ls -als” on the found files.
Sample output of the above command on a Solaris 8 box:
hostname# find /var -type f -name "*.log" -mtime -2 -exec ls -als {} ; 1392 -rw-r--r-- 1 root other 700056 Nov 21 23:40 /var/log/magstar_atl.log 4 -rw-rw-rw- 1 perf perf 1335 Nov 21 00:15 /var/opt/perf/logs/sitedailyora_startup.log 76 -rw-r--r-- 1 root other 38716 Nov 21 23:30 /var/yp/ypxfr.log 7328 -rw-r--r-- 1 root other 3742300 Nov 21 11:47 /var/VRTSvcs/log/engine_A.log
Instead of “ls -als” in the above example you can substitute any command or a script name.
I use web page http://my.naukri.com/manager/createacc2.php?othersrcp=11499&wExp=N And I use jquery console. On the jquery console I execute the two commands mentioned below. The commands selects user “city” location in the html form. The command works successfully alternate times – that is commands execute and select the city correctly when run first time, but fail next time, and succeed next time and so on. Why?
The commands are (to be run one after another and in batch mode):
$(‘#inpcityContainerDD’).click()
$(‘#cityContainerDD a[rel=06]’).click()