0

I downloaded Yara from Git. When I run yara from terminal, it works as I would expect. I want to know if it's possible to create a bash script that would let me call yara and then execute my command.

Any help would be greatly appreciated!

yara -w /path/path/path works in terminal

yara -w in a shell script does not execute as I would want.

  • What's the issue you're seeing with latter (in a shell script)? – Sharad May 27 '19 at 06:41
  • Apologies, I should have been more clear. It runs fine in the shell script, however, when I call the script from Xcode, it states "yara: command not found" – Nick Iacuzio May 27 '19 at 11:12

1 Answers1

0

When you run it from shell, your environment is set.

For e.g., if your default shell is bash, then ~/.bashrc or ~/.profile sets them (/etc/profile is sourced as well).

Via Xcode, this doesn't happen automatically. So, $PATH doesn't have the location for yara.

You may:

  • Use the complete path for yara from Xcode
  • OR Source ~/.bashrc or ~/.profile in Xcode (if there's such an option)) before using yara
  • OR Configure the $PATH settings in Xcode to point to the location where yara is installed. You can find it by running which yara in the shell.
Sharad
  • 9,282
  • 3
  • 19
  • 36