advanced-shell-history icon indicating copy to clipboard operation
advanced-shell-history copied to clipboard

"FAILED TO FIND A FILE TO PARSE!"

Open dkokron opened this issue 2 years ago • 3 comments

Fresh build and install on an Ubuntu-22.04.1 system.

I added the following to my .bashrc

source /usr/local/etc/advanced-shell-history/config export ASH_CFG_SYSTEM_QUERY_FILE source /usr/local/lib/advanced_shell_history/sh/bash

source ~/.bashrc Advanced Shell History enabled: session 1

ash_query -Q FAILED TO FIND A FILE TO PARSE!

This snippet from src/queries.cpp is looking for files in /etc/ash/queries and $HOME/.ash/queries /**

  • Loads the configured files looking for saved queries. */ void Queries::lazy_load() { // Prevent multiple loads, but allow loads for on-demand use. static bool loaded = false; if (loaded) return; loaded = true;

LOG(DEBUG) << "Loading query files for saved queries.";

// Load these files, in this order. query::files.push_back("/etc/ash/queries"); query::files.push_back(string(getenv("HOME")) + "/.ash/queries");

// Initialize the input file. yyin = 0; if (yywrap()) { cout << "FAILED TO FIND A FILE TO PARSE!" << endl; exit(1); }

Neither of those queries files exist on my machine. Did I miss something in the build or installation steps?

dkokron avatar Feb 14 '23 17:02 dkokron

Which os are you using?

On Tue, Feb 14, 2023, 11:55 AM dkokron @.***> wrote:

Fresh build and install on an Ubuntu-22.04.1 system.

I added the following to my .bashrc

source /usr/local/etc/advanced-shell-history/config export ASH_CFG_SYSTEM_QUERY_FILE source /usr/local/lib/advanced_shell_history/sh/bash

source ~/.bashrc Advanced Shell History enabled: session 1

ash_query -Q FAILED TO FIND A FILE TO PARSE!

This snippet from src/queries.cpp is looking for files in /etc/ash/queries and $HOME/.ash/queries /**

  • Loads the configured files looking for saved queries. */ void Queries::lazy_load() { // Prevent multiple loads, but allow loads for on-demand use. static bool loaded = false; if (loaded) return; loaded = true;

LOG(DEBUG) << "Loading query files for saved queries.";

// Load these files, in this order. query::files.push_back("/etc/ash/queries"); query::files.push_back(string(getenv("HOME")) + "/.ash/queries");

// Initialize the input file. yyin = 0; if (yywrap()) { cout << "FAILED TO FIND A FILE TO PARSE!" << endl; exit(1); }

Neither of those queries files exist on my machine. Did I miss something in the build or installation steps?

— Reply to this email directly, view it on GitHub https://github.com/barabo/advanced-shell-history/issues/23, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBEHHG4CMGGLZ7HRUAAUNDWXPBIPANCNFSM6AAAAAAU332DAQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

barabo avatar Feb 17 '23 02:02 barabo

Ubuntu-22.04.1

On Thu, Feb 16, 2023 at 8:41 PM Carl Anderson @.***> wrote:

Which os are you using?

On Tue, Feb 14, 2023, 11:55 AM dkokron @.***> wrote:

Fresh build and install on an Ubuntu-22.04.1 system.

I added the following to my .bashrc

source /usr/local/etc/advanced-shell-history/config export ASH_CFG_SYSTEM_QUERY_FILE source /usr/local/lib/advanced_shell_history/sh/bash

source ~/.bashrc Advanced Shell History enabled: session 1

ash_query -Q FAILED TO FIND A FILE TO PARSE!

This snippet from src/queries.cpp is looking for files in /etc/ash/queries and $HOME/.ash/queries /**

  • Loads the configured files looking for saved queries. */ void Queries::lazy_load() { // Prevent multiple loads, but allow loads for on-demand use. static bool loaded = false; if (loaded) return; loaded = true;

LOG(DEBUG) << "Loading query files for saved queries.";

// Load these files, in this order. query::files.push_back("/etc/ash/queries"); query::files.push_back(string(getenv("HOME")) + "/.ash/queries");

// Initialize the input file. yyin = 0; if (yywrap()) { cout << "FAILED TO FIND A FILE TO PARSE!" << endl; exit(1); }

Neither of those queries files exist on my machine. Did I miss something in the build or installation steps?

— Reply to this email directly, view it on GitHub https://github.com/barabo/advanced-shell-history/issues/23, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABBEHHG4CMGGLZ7HRUAAUNDWXPBIPANCNFSM6AAAAAAU332DAQ

. You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/barabo/advanced-shell-history/issues/23#issuecomment-1434016309, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACODV2FHYICSHVPKBSDCWVDWX3QMDANCNFSM6AAAAAAU332DAQ . You are receiving this because you authored the thread.Message ID: @.***>

dkokron avatar Feb 17 '23 15:02 dkokron

I enabled DEBUG logging in /usr/local/etc/advanced-shell-history/config and see

2023-08-21 07:50:38 AEST: SESSION 312: DEBUG: File could not be opened: /etc/ash/queries 2023-08-21 07:50:38 AEST: SESSION 312: DEBUG: File could not be opened: /home/wozza/.ash/queries

So I copied the file from the repo

cp queries ~/.ash/

Now I see

Loading query files for saved queries. 2023-08-21 07:54:14 AEST: SESSION 312: DEBUG: File could not be opened: /etc/ash/queries 2023-08-21 07:54:14 AEST: SESSION 312: DEBUG: Done parsing config files. Query Description CWD Shows the history for the current working directory only. DEMO Shows who did what, where and when (not WHY). ME Select the history for just the current session. RCWD Shows the history rooted at the current working directory.

warrenc5 avatar Aug 20 '23 21:08 warrenc5