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

"stray \ before !" in script #177

Open
szigetva opened this issue Feb 25, 2023 · 1 comment
Open

"stray \ before !" in script #177

szigetva opened this issue Feb 25, 2023 · 1 comment

Comments

@szigetva
Copy link

szigetva commented Feb 25, 2023

I got the error message .grep: warning: stray \ before ! when bb ran. I changed \! to ! in two lines in the script, which fixed the error.

Here's the diff:

710c710 < nposts=$(grep -c "<\!-- text begin -->" "$i") --- > nposts=$(grep -c "<‍!-- text begin -->" "$i") 870c870 < nposts=$(grep -c "<\!-- text begin -->" "$i") --- > nposts=$(grep -c "<‍!-- text begin -->" "$i")

Note that I had to add a zero-width space in the code above so that it renders properly, I guess you can't just copy it as is.


Edit 2023-02-27:
With this modification the footer is inserted twice. The issue remains, my solution above is not adequate.

@btcbobby
Copy link

btcbobby commented Jun 4, 2024

redirect stderr from grep command to /dev/null by changing the line as follows:

nposts=$(grep -c "<‍!-- text begin -->" "$i" 2>/dev/null)

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

2 participants