topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday December 15, 2024, 4:38 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: alias help using ScanFs (to grep files from the FARR command line?)  (Read 3524 times)

ottenm

  • Supporting Member
  • Joined in 2008
  • **
  • default avatar
  • Posts: 93
    • View Profile
    • Donate to Member
I'm hoping to grep text files from the FARR command line, or at least open ScanFs with the arguments I type in to FARR.

Based on this 10-year old thread: https://www.donation...ex.php?topic=13567.0
... I end up with the following alias in myaliases.alias (just changing the launch path).

<AliasText>grep</AliasText>
<Score>1000</Score>
<Results>
<Result>grep $$1 $$2 | C:\Users\user\AppData\Roaming\Saleen Software\Saleen ScanFs\ScanFs.exe /path=$$1 /contents=&quot;$$2&quot;&gt;+&gt;^grep (\S*) (.*)</Result>
</Results>

If I type "grep" into FARR it opens ScanFs, but has whatever I typed in to ScanFs the last time it ran.  If I try to add arguments in FARR ("grep *.txt needle") I just get from FARR "Sorry, no results."

Any suggestions *greatly* appreciated!


Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: alias help using ScanFs (to grep files from the FARR command line?)
« Reply #1 on: January 23, 2018, 09:37 AM »
It looks like you're conflating the syntax for direct editing in the myaliases.alias file and the import syntax for the FARR options GUI.

Try creating a new alias entry in the FARR options GUI.
Go to FARR help > program options > Lists > Aliases... > myaliases.alias and click the "Add a new Alias" button and enter these

Alias trigger:
grep
Score:
1000
Regular Expressions pattern:
^grep (\S*) (.*)
Results:
grep $$1 $$2 | C:\Users\user\AppData\Roaming\Saleen Software\Saleen ScanFs\ScanFs.exe /path="$$1" /contents="$$2"


Also, try the below command in Windows cmd, but replace <file path> and <search string> with something useful. If it doesn't work look up the correct parameter syntax for ScanFs.exe
C:\Users\user\AppData\Roaming\Saleen Software\Saleen ScanFs\ScanFs.exe /path="<file path>" /contents="<search string>"

ottenm

  • Supporting Member
  • Joined in 2008
  • **
  • default avatar
  • Posts: 93
    • View Profile
    • Donate to Member
Re: alias help using ScanFs (to grep files from the FARR command line?)
« Reply #2 on: January 23, 2018, 08:17 PM »
Thank you for your help Nod5!  Looks like something in ScanFs.  It opens, but isn't reflecting any command line args.  I wrote an app just to display the command args, and called it with a search string and a file path, and they look fine.

Thanks a ton!  Will figure out what's happening down stream-