Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Done bash style directory bookmarks

Jan
40
0
There is a bash shell script that provides directory bookmarks. Is it possible to do this in tcc? It should be easy, esp since it's easy to do in bash w/ a shell script.
git clone icyfork/dirb

to see what I'm talking about. I've been doing this for a decade in bash.

This is similar to directory aliases, but having a syntax that is the same in both bash and tcc would be really, really nice.
 
TCC has directory aliases. With automatic directory changes, they come pretty close.

Code:
v:\> docs:

c:\users\vefatica\documents>
 
Does tcc have embedded execution, like bash?
In bash, I can write
$cd $(program)
or
$cd `program`

And the output of program will be substituted.
Is something like that possible in tcc?
 
Does tcc have embedded execution, like bash?
In bash, I can write
$cd $(program)
or
$cd `program`

And the output of program will be substituted.
Is something like that possible in tcc?
Yes but it's a little more cumbersome. Look at @EXECSTR. Here's an example of picking out a line of output and a word within that line.

Code:
v:\> echo The spooler service is %@word[3,%@execstr[3,sc query spooler]].
The spooler service is RUNNING.
 
If you use EverythingSearch, you can type partial names and a dialog will pop up asking which directory you want.
 
I have not found that to be as useful. Especially if there are a lot of hits.

I have solved this by writing my own program in Go, that I called dirbkmk. Then I created this alias
g %@execstr[dirbkmk %1]

And that does what I want. And its as fast as I want it to be.

So that issue is solved, for me.
 
I am looking for the syntax to be the same on bash and tcc. The bash shell script already uses g (meaning go to target directory). And as it's only 1 letter, it's as good as any abbreviation.
 
My previous answer was not clear enough. If I do not use @execstr, I cannot get my directory bookmarking program to actually change directories. IE, it only works w/ @execstr.
 

Similar threads

Back
Top