Welcome!

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

SignUp Now!

How to? Alias with more not working right

Jul
50
1
This alias is driving me nuts.

ff=iff %1. NE . then %+ "c:\program files\everything\es.exe" -w %1 | more %+ else %+ "c:\program files\everything\es.exe" -h %+ endiff

If I take out the more it works fine.
As it is when ran it will first run the tcstart.btm (but skip any pause statements I added to verify what was happening) I put a beep in the tcstart to verify the tcstart was running since it was skip the pause statement (Strange). Also with the pause, the alias does not work correctly. It does not find any files.
 
The issue is that the pipe symbol breaks the WHOLE command. I would put the everything and the more commands into a command group like this:

ff=iff %# GT 0 then %+ ( "c:\program files\everything\es.exe" -w %1 | more ) %+ else %+ "c:\program files\everything\es.exe" -h %+ endiff

Note that I also changed the parameter test to checking parameter count instead of evaluating the first parameter (we have a lot more features available than COMMAND.COM where I, too, used that technique). I would also use the internal LIST command without any options instead of the external more, which has many more features, yet just as simple to invoke.
 
Thanks. I knew it was something simple. Your version worked great.

Now I changed it to the following (replaced more with *list):

ff=iff %# GT 0 then %+ ( "c:\program files\everything\es.exe" -w %1 | *list ) %+ else %+ "c:\program files\everything\es.exe" -h %+ endiff

And now it is doing the same as before.
 
Now I changed it to the following (replaced more with *list):

ff=iff %# GT 0 then %+ ( "c:\program files\everything\es.exe" -w %1 | *list ) %+ else %+ "c:\program files\everything\es.exe" -h %+ endiff

And now it is doing the same as before.
Do you mean with no alias parameter it does not work?
I am not familiar with the EVERYTHING program, even if it is now bundled with TCMD. Is it a text-mode ("console") or a GUI program? Does it create its own window?
 
Found an option that works with list.
ff=iff %# GT 0 then %+ ( "c:\program files\everything\es.exe" -w %1 >files.txt %+ *list files.txt %+ del /k files.txt ) %+ else %+ "c:\program files\everything\es.exe" -h %+ endiff

Steve's version for more also worked great:
ff=iff %# GT 0 then %+ ( "c:\program files\everything\es.exe" -w %1 | more ) %+ else %+ "c:\program files\everything\es.exe" -h %+ endiff
Keith
 
Now I suggest you either put es.exe on you path, or make an alias, e.g.,
alias es="c:\program files\everything\es.exe"
which would allow you to use just es as the command, both in the ff alias and at the command line.
 

Similar threads

Back
Top