add recipies
This commit is contained in:
37
README.md
37
README.md
@@ -47,4 +47,41 @@ This has some issues:
|
||||
Interestingly, I found the same trick they use to allow for menus to be printed but also pipe the output.
|
||||
By putting them menu on `stderr` instead of `stdout` you can have a menu that doesn't get yoinked by the pipe's reidrection.
|
||||
|
||||
# Recipies
|
||||
|
||||
> Note: I have the program wrapper script on my `$PATH` and have the wrapper script renamed to `opts`.
|
||||
|
||||
|
||||
Show all directories, entering the selected one.
|
||||
|
||||
```bash
|
||||
cd $(ls -la | grep dr | awk '{ print $9 }' | opts)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
Show all partitions, mounting the selected one at `/mnt`.
|
||||
|
||||
```bash
|
||||
sudo mount $(lsblk -lno type,name | grep part | awk '{ print "/dev/" $2 }' | opts) /mnt
|
||||
```
|
||||
|
||||
You could even do the filtering after the fact, to give the user more info.
|
||||
```bash
|
||||
sudo mount $(lsblk | opts | awk '{ print $1 }') /mnt
|
||||
```
|
||||
(But this would allow you to select bad data.)
|
||||
|
||||
---
|
||||
|
||||
Choose what video codec to change all the videos in the current directory to.
|
||||
|
||||
```bash
|
||||
OPTS="mpeg4\nh265\nh264"
|
||||
SEL=$(printf $OPTS | opts)
|
||||
|
||||
for x in $(ls); do
|
||||
ffmpeg -i $x -v:c $SEL ${x}-enc.mp4
|
||||
done
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user