Done bash style directory bookmarks

Jan 13, 2013
27
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.
 
May 20, 2008
12,171
133
Syracuse, NY, USA
TCC has directory aliases. With automatic directory changes, they come pretty close.

Code:
v:\> docs:

c:\users\vefatica\documents>
 
Jan 13, 2013
27
0
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?
 
May 20, 2008
12,171
133
Syracuse, NY, USA
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.
 

samintz

Scott Mintz
May 20, 2008
1,555
26
Solon, OH, USA
If you use EverythingSearch, you can type partial names and a dialog will pop up asking which directory you want.
 
Jan 13, 2013
27
0
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.
 
Jan 13, 2013
27
0
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.
 
Jan 13, 2013
27
0
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