Grep GUI Utility
by John Vincent
Posted on May 1, 2018
The purpose is to be to track down useful code quickly and without the usual fussing around.
- Provide search string(s)
- Directory to be searched.
- File type(s) to be searched.
Lists all occurances.
Drag and Drop file pathname to lower pane to edit the file.
- Drag and Drop
To execute app from the command line, use
At Github, create repository
cd /Users/jv/Desktop/MyDevelopment/github/java/Utilities create-repo java-grep
Remove non-relevant files.
For details, see grep/README.md
Right click, Services
Create Java Project
- File, New, Project
- Java Project
- Project Name: grep
- Use default location
- JRE; Use an execution environment JRE: JavaSE-1.8
- Create separate folders for sources and class files
- Default output folder:
- Right click, New, Package
Copy code to this package and change package names.
#!/bin/sh # # script to run java app grepdirGui # DEV_HOME=/Users/jv/Desktop/MyDevelopment/github/java/Utilities/java-grep/grep # cd $DEV_HOME # MYCP=$DEV_HOME/classes:$DEV_HOME/Jars/log4j-1.2.13.jar # MY_FILE=/Users/jv/Desktop/MyDevelopment/github/java/Utilities/java-grep/grep/grepdir.properties # java -cp $MYCP io.johnvincent.grepgui.GrepdirGui $MY_FILE
Create Symbolic Link
ln -s /Users/jv/Desktop/MyDevelopment/github/java/Utilities/java-grep/grep/grepdir.command /Users/jv/Desktop/MyDevelopment/github/repo_shell_scripts/mac/unix-scripts/bin/java-grep
Save Grep as a Mac App
Execute from Finder
- Go, Applications
- Execute: Automator (or Automator.app)
- Quick Action, or
and then select
From the middle pane, double click Run Shell Script
Shell: /bin/bash Pass input: as arguments
- File, Save:
- Save as: java-grep
- Where: Applications
saves java-grep.app in Applications.