fix variable syntax
This commit is contained in:
3
cmd.mk
3
cmd.mk
@@ -20,9 +20,6 @@ $(lists): lists/%.md: command.rec | lists/
|
|||||||
@printf '%s\n' '---' >> $@
|
@printf '%s\n' '---' >> $@
|
||||||
@$(call list_commands,$(basename $(notdir $@))) >> $@
|
@$(call list_commands,$(basename $(notdir $@))) >> $@
|
||||||
|
|
||||||
.PHONY: cmd
|
|
||||||
cmd: $(lists) ## Big lists of commands
|
|
||||||
|
|
||||||
.PHONY: function
|
.PHONY: function
|
||||||
function: ## Output a search function for .bashrc
|
function: ## Output a search function for .bashrc
|
||||||
${MAKE} --silent --touch query
|
${MAKE} --silent --touch query
|
||||||
|
|||||||
@@ -16,23 +16,23 @@ Make a database for your boardgames, specifying only one field and value:
|
|||||||
database=games.rec
|
database=games.rec
|
||||||
n=Name
|
n=Name
|
||||||
g=Vojvodina
|
g=Vojvodina
|
||||||
touch $database
|
touch ${database}
|
||||||
recins -f $n --value $g $database
|
recins -f ${n} --value ${g} ${database}
|
||||||
recsel $database
|
recsel ${database}
|
||||||
```
|
```
|
||||||
|
|
||||||
Insert a few more, with the estimated playtime:
|
Insert a few more, with the estimated playtime:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
recins -f Name -v Saboter -f Playtime -v 30 $database
|
recins -f Name -v Saboter -f Playtime -v 30 ${database}
|
||||||
recins -f Name -v Chess -f Playtime -v 30 $database
|
recins -f Name -v Chess -f Playtime -v 30 ${database}
|
||||||
```
|
```
|
||||||
|
|
||||||
View all games, or select one by number:
|
View all games, or select one by number:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
recsel $database
|
recsel ${database}
|
||||||
recsel -n 0 $database
|
recsel -n 0 ${database}
|
||||||
```
|
```
|
||||||
|
|
||||||
Each game should note whether or not you have played it yet, so you can add that field and set the default to `yes`.
|
Each game should note whether or not you have played it yet, so you can add that field and set the default to `yes`.
|
||||||
@@ -40,14 +40,14 @@ Each game should note whether or not you have played it yet, so you can add that
|
|||||||
```sh
|
```sh
|
||||||
f=played
|
f=played
|
||||||
v=yes
|
v=yes
|
||||||
recset -f $f -a $v $database
|
recset -f ${f} -a ${v} ${database}
|
||||||
```
|
```
|
||||||
|
|
||||||
...but the field is wrong, it should have a capital letter:
|
...but the field is wrong, it should have a capital letter:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
new_field=Played
|
new_field=Played
|
||||||
recset -f $f --rename $new_field
|
recset -f ${f} --rename ${new_field}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Read
|
## Read
|
||||||
@@ -55,20 +55,20 @@ recset -f $f --rename $new_field
|
|||||||
Check how many records the database has:
|
Check how many records the database has:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
recinf $database
|
recinf ${database}
|
||||||
```
|
```
|
||||||
|
|
||||||
Look at just the games you've never played:
|
Look at just the games you've never played:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
recsel --expression="Played = 'no'" $database
|
recsel --expression="Played = 'no'" ${database}
|
||||||
```
|
```
|
||||||
|
|
||||||
Print how many, then just print the names:
|
Print how many, then just print the names:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
recsel -e "Played = 'no'" --count $database
|
recsel -e "Played = 'no'" --count ${database}
|
||||||
recsel -e "Played = 'no'" --print=Name $database
|
recsel -e "Played = 'no'" --print=Name ${database}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Update
|
## Update
|
||||||
@@ -79,8 +79,8 @@ To change a game's `Played` field from `no` to `yes`, use `recset` to specify th
|
|||||||
num=0
|
num=0
|
||||||
f=Played
|
f=Played
|
||||||
value=yes
|
value=yes
|
||||||
recsel --number=$num $database
|
recsel --number=${num} ${database}
|
||||||
recset --number=$num -f $f --set=$value $database
|
recset --number=${num} -f ${f} --set=${value} ${database}
|
||||||
```
|
```
|
||||||
|
|
||||||
Find all games with a playtime of `30`, and set the field `Max_Players` to `4`.
|
Find all games with a playtime of `30`, and set the field `Max_Players` to `4`.
|
||||||
@@ -102,22 +102,22 @@ Remove `Played` record from first game:
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
num=0
|
num=0
|
||||||
recset --number=$num -f Played --delete $database
|
recset --number=${num} -f Played --delete ${database}
|
||||||
```
|
```
|
||||||
|
|
||||||
You can comment the line instead of deleting it:
|
You can comment the line instead of deleting it:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
num=1
|
num=1
|
||||||
recset --number=$num -f Played --delete $database
|
recset --number=${num} -f Played --delete ${database}
|
||||||
recsel $database
|
recsel ${database}
|
||||||
cat $database
|
cat ${database}
|
||||||
```
|
```
|
||||||
|
|
||||||
Delete an entire record:
|
Delete an entire record:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
num=2
|
num=2
|
||||||
recdel --number=$num $database
|
recdel --number=${num} ${database}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user