mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 21:52:48 +00:00
Add multiple commands, add info about | meaning either/or, and fix formatting error in first section
parent
d904b33e2c
commit
f025ede24e
18
Scripting.md
18
Scripting.md
@ -12,7 +12,7 @@ To run a script that's not present in this folder, it can be manually executed b
|
||||
|
||||
### Basics
|
||||
|
||||
GodMode9 scripts resemble shell scripts. Comments are denoted by `#` and work anywhere. Variable are in the format `$[VAR]` where `VAR` is the name of the variable. (i.e. $[HAX]). Surround an argument with `"` if it must contain whitespaces. Any redundant whitespaces outside of `"` will be treated as a single whitespace.
|
||||
GodMode9 scripts resemble shell scripts. Comments are denoted by `#` and work anywhere. Variable are in the format `$[VAR]` where `VAR` is the name of the variable. (i.e. `$[HAX]`). Surround an argument with `"` if it must contain whitespaces. Any redundant whitespaces outside of `"` will be treated as a single whitespace.
|
||||
An unknown command will lead to a script abort.
|
||||
|
||||
#### Wildcards
|
||||
@ -26,7 +26,7 @@ Example: `ask -o -s "Perform this operation (I will completely ignore your respo
|
||||
### Commands
|
||||
|
||||
A short description of every command. Click on the command to go to a more detailed page about it.
|
||||
`<>` Denotes a required parameter. `[]` denotes an optional parameter.
|
||||
`<>` Denotes a required parameter. `[]` denotes an optional parameter. A `|` in a parameter means that you must choose one of the options on either side of it.
|
||||
|
||||
[**echo** command](/d0k3/GodMode9/wiki/Scripting:--echo) - Outputs data to the screen. Syntax: `echo "<text to be outputted>"` Example: `echo "Hello There!"`
|
||||
|
||||
@ -50,6 +50,20 @@ A short description of every command. Click on the command to go to a more detai
|
||||
|
||||
**fdummy** command - creates a dummy file at the specified location of a specified size. Existing files will not be overwritten. Syntax: `fdummy <path> <size in hex>` Example: `fdummy 0:/testfile.bin FF` (FF is 256 in regular numbers)
|
||||
|
||||
**cp** command - copies a file or directory to another place. `-h` creates a .sha file with the same name containing the file's SHA-256 (only on SD card). `-w` forces overwrite of existing files (rather than a prompt allowing the user to choose). `-k` is the same as `-w` but forces a skip. `-n` prevents canceling the operation (useful for critical operations). Syntax: `cp <path to file> <path to file copy>` Example: `cp -h -n S:/nand_minsize.bin 0:/gm9/out/NAND_backup.bin`
|
||||
|
||||
**rm** command - removes files and directories recursively. Syntax: `rm <path-to-remove>` Example: `rm 9:/*`
|
||||
|
||||
**mv** command - used to move and/or rename files. Same switches as `cp`, except for `-h`. Syntax: `mv <path to file> <path to new location` Example: `mv 0:/gm9/out/NAND_backup.bin 0:/gm9/out/$[DATESTAMP]_$[SERIAL]_sysnand_000.bin`
|
||||
|
||||
**imgmount** command - used to mount an image. An image can be (among other things) FAT, NAND, NCCH, FIRM, BOSS, NCSD, CIA, ticket.db... Syntax: `imgmount <path>` Example: `imgmount 1:/dbs/ticket.db`
|
||||
|
||||
**imgumount** command - unmounts the currently mounted image. No parameters.
|
||||
|
||||
**sha** command - checks a file's SHA-256 against the second argument, which can either be a file containing the SHA-256 (`.sha` files created by GM9), or the SHA-256 string in hex. Syntax: `sha <path> <path/sha string>` Example: `sha S:/sector0x96.bin 82F2730D2C2DA3F30165F987FDCCAC5CBAB24B4E5F65C981CD7BE6F438E6D9D3`
|
||||
|
||||
**shaget** command - besides sounding like some a very hairy dog, this command will calculate and store a file's SHA-256 in the second argument, be it a variable or filename. Syntax: `shaget <file to calc> <file name / var name>` Example: `shaget 0:/boot.firm BOOTSHA`
|
||||
|
||||
[more to come ofc]
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user