Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"FAILED TO FIND A FILE TO PARSE!" #23

Open
dkokron opened this issue Feb 14, 2023 · 3 comments
Open

"FAILED TO FIND A FILE TO PARSE!" #23

dkokron opened this issue Feb 14, 2023 · 3 comments

Comments

@dkokron
Copy link

dkokron commented Feb 14, 2023

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?

@barabo
Copy link
Owner

barabo commented Feb 17, 2023 via email

@dkokron
Copy link
Author

dkokron commented Feb 17, 2023 via email

@warrenc5
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants