Hi
I tried following your suggestions with no success.. I hammered away at it for a while but didn't find a clear syntax that worked.
If you can describe more specifically what doesn't work, it would be easier to help. What happens when it "doesn't work", are there any error messages?
The syntax you are using seems to be generally correct, so my guess is the failure is caused by behavior you didn't expect rather than syntax.
My approach to something like this would adding adding pieces until one fails and then try to figure out why that one fails.
As I mentioned in the earlier post, the most obvious difference between putting it all on the command line and entering it manually in the chdkptp console is timing, because entering the commands manually adds delays between the commands. If that is the problem, the pasting the same sequence of commands into the console as a single = line should fail in the same way.
If that's true, than you should be able to identify which one fails and start adding delays.
Considering there are many fine examples of Lua scripts, I'm wondering if there is another way to proceed.. perhaps by invoking a more complete Lua script from bash, instead of the base chdkptp.sh with extended options?
Yes, there are quite a few ways you can do this.
You can put a sequence of chdkptp commands (that you would enter at the chdkptp prompt, like 'rec' or 'luar' etc) and execute them with chdkptp.sh -e"source myfile.txt"
You write chdkptp side lua code and run it with -e"exec dofile('myfile.lua')"
You could also combine all the camera side lua you are sending with luar into a single file and run that, for example using
-e'luar <mycamfile.lua'
Note in this case the < is intended for chdkptp, so must be protected from bash by quotes if you use it from the command line.
My understanding of when to use ";" is unclear and I can't find any examples to follow.
You basically don't need to use ";" in lua. You can use it instead of space if you want.
print('hello');print('world')
and
print('hello') print('world')
and
print('hello')
print('world')
all do exactly the same thing.