DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

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

ottenm

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 93
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: http://www.donationcoder.com/forum/index.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,175
    • Coding Snacks
    • Participated in NANY Challenge Three Times
    • Plugin Coding Medal
Re: alias help using ScanFs (to grep files from the FARR command line?)
« Reply #1 on: January 23, 2018, 03:37 PM »
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:
Code
grep
Score:
Code
1000
Regular Expressions pattern:
Code
^grep (\S*) (.*)
Results:
Code
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
Code
C:\Users\user\AppData\Roaming\Saleen Software\Saleen ScanFs\ScanFs.exe /path="<file path>" /contents="<search string>"

ottenm

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 93
Re: alias help using ScanFs (to grep files from the FARR command line?)
« Reply #2 on: January 24, 2018, 02:17 AM »
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-

Original address: https://www.donationcoder.com/forum/index.php?topic=44977.0