jq, but HTML instead of JSON ๐ง
mlq -r '#imAnID' file.html
More usage, in the next lines; so please continue reading. Let's focus first in the first:
Open the Withcraft/Terminal/Prompt and type + press [ENTER]
:
curl --proto '=https' --tlsv1.3 -sSf https://raw.githubusercontent.com/Floflis/mlq/main/install.sh | sh
If you don't trust downloading+executing a script, you can do it locally.
Open terminal and type following by pressing [ENTER]
:
Floflis, Floflis-based distros such as UniOS and any other that uses nu shell:
git clone https://github.com/Floflis/mlq.git ; cd mlq
After reviewing the code of install.sh:
chmod +x install.sh ; sh ./install.sh
git clone https://github.com/Floflis/mlq.git && cd mlq
After reviewing the code of install.sh:
chmod +x install.sh && sh ./install.sh
mlq '#imAnID = "<desired>CONTENT</desired>"' file.html
You can write out the output to any file/place; its up to your creativity.
contents="$(mlq '#imAnID = "<desired>CONTENT</desired>"' file.html)" && \
echo "${contents}" > file.html
Note: this tool isn't professional nor native. You are free to make a program with the same name (mlq) in Rust, then ask us to replace this by yours; but a better idea would be to contribute to/complete something existing: htmlq
The positive points about mlq:
- short name/command
- lower entry barrier, as there are more Bash than C/Rust/Perl developers (so it can have more features than others and developed in a faster pace)