DIY-Actions: Execute Command, Execute Root Command

Post your questions and help other users.

Moderator: Martin

User avatar
Martin
Posts: 4297
Joined: 09 Nov 2012 14:23

Re: DIY-Actions: Execute Command, Execute Root Command

Post by Martin » 02 Sep 2013 16:09

Hi,

Ensure to add a trigger to the flow first since this will provide the variable triggertime to the flow. The variable selection dialog should contain some example formats (when editing the action: Menu->Select Variable).

You can get the formatted time and date as follows:
/mnt/sdcard/screencap_{triggertime,dateformat,yyyyMMdd_HHmmss}.png

Please also check this page: Date Format Pattern

Regards,
Martin

houdinix64
Posts: 33
Joined: 08 Mar 2013 12:45

Re: DIY-Actions: Execute Command, Execute Root Command

Post by houdinix64 » 23 Oct 2013 05:23

I need help. I can't find a way to execute pressing the " Back button (hardware key)" ?

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: DIY-Actions: Execute Command, Execute Root Command

Post by MURTUMA » 23 Oct 2013 09:05

In the third post is a link to all key codes and their numeric equivalents. The numbers should work on all devices.

Martin: could you update that link to the first post so people find that more easily?

User avatar
Martin
Posts: 4297
Joined: 09 Nov 2012 14:23

Re: DIY-Actions: Execute Command, Execute Root Command

Post by Martin » 23 Oct 2013 16:22

Sure, added the link to the first post.

User avatar
Bushmills
Posts: 286
Joined: 23 Sep 2014 21:56

Re: DIY-Actions: Execute Command, Execute Root Command

Post by Bushmills » 13 May 2016 14:35

The mv command as part of your shell script doesn't have Automagic variables within its scope. Two ways to solve that are:
1. Pass variables as command arguments to your script, read them in your script as positional parameters ("command line arguments"), or
2. use equivalent variables or command output, provided or generated by shell. For example, by
"mv file $(date +%s).ext"

Post Reply