I have been using a couple of small extra scripts lately, that I found to be very useful. They are quite low quality, and I am now thinking about improving their quality and seeing if they should be added to the project. For reference:
the grep script takes a list of words, looks for them in the z database, and prints the ordered, numbered outputs. The grepping also has color highlighting, which I find useful.
the execute script takes one of these numbers, and moves to the corresponding folder. I find it very convenient when there may be several possible matches.
See the illustration:
I was thinking about adding these scripts in the following ways:
creating a z -g that does the same as the grep script: 1) take 1 or several words, 2) use these to grep the z database with highlighting etc 3) prints the results
creating a z -x that takes in a number n and that does the same as the execute script, in the following way: 1) get the latest history entry 2) check that it is a z -g command 3) if it is not, issue an error message, if it is 4) re-run the command, and grab the output 5) if n > number of output lines, error, otherwise, 6) move to the n-th output.
Any commends around that? Things that could / should be done better?
First, many thanks for a really great tool!
I have been using a couple of small extra scripts lately, that I found to be very useful. They are quite low quality, and I am now thinking about improving their quality and seeing if they should be added to the project. For reference:
https://github.com/jerabaul29/my_bash_scripts/blob/master/zg.sh
https://github.com/jerabaul29/my_bash_scripts/blob/master/zx.sh
Basically the workflow is as visible under:
the grep script takes a list of words, looks for them in the z database, and prints the ordered, numbered outputs. The grepping also has color highlighting, which I find useful.
the execute script takes one of these numbers, and moves to the corresponding folder. I find it very convenient when there may be several possible matches.
See the illustration:
I was thinking about adding these scripts in the following ways:
creating a
z -g
that does the same as the grep script: 1) take 1 or several words, 2) use these to grep the z database with highlighting etc 3) prints the resultscreating a
z -x
that takes in a number n and that does the same as the execute script, in the following way: 1) get the latest history entry 2) check that it is az -g
command 3) if it is not, issue an error message, if it is 4) re-run the command, and grab the output 5) if n > number of output lines, error, otherwise, 6) move to the n-th output.Any commends around that? Things that could / should be done better?