Skip to main content

All Questions

Tagged with
0 votes
1 answer
65 views

How to use grep string that has double quotes in it

So I'm running a simple alias called vpn which runs a command and has an output, which I put into a .txt file. If interested to what exactly then here is the alias alias vpn="docker exec -it ...
Arelius's user avatar
  • 73
-1 votes
1 answer
42 views

I can't grep some inputrc string

bind -p |grep -E "\\e.\":" work but bind -p |grep -E "\\e\\C-.\":" don't work I tried a lot of combination
user3634569's user avatar
-1 votes
3 answers
94 views

How to use a variable in a command inside of a bash file

I use this command directly on our redhat linux server 8.8 and it's working correctly and I get the result I want: grep '01-FEB-2024' /u01/app/server1/listener_scan/trace/listener_scan.log | awk '{ if ...
TimLer's user avatar
  • 101
3 votes
1 answer
7k views

Grep pattern that has double quotes and variable substitution surrounded by single quotes

So, Let's say I have the following pattern: Thisisatest="1" in a file called file. And I want to match the exact string above but for whatever reason, I choose to loop over some numbers ...
Nordine Lotfi's user avatar
1 vote
1 answer
2k views

grep: use square brackets to match specific characters

So I am experimenting with the power of grep using this resources The problem I am currently encountering is that it doesn't seem to work as I intended. so I have an demo.txt file that contains foo....
jxhyc's user avatar
  • 181
3 votes
1 answer
2k views

prevent single quotes in bash script

I have a bash script that's just a shortcut to the grep command. I call it like this: stx -p /var/www -t 'my text' This would run this command: sudo grep -rinI /var/www -e 'my text' I'm trying to ...
raphael75's user avatar
  • 733
5 votes
2 answers
26k views

How do I grep multiple patterns from a pipe

I want to find three patterns in a list. I tried typing $ pip3 list | grep -ei foo -ei bar -ei baz but the shell throws a broken pipe error and a large Traceback. How do I grep for multiple ...
bit's user avatar
  • 1,116
1 vote
1 answer
325 views

grep not working when I enclose the directory in double quotes

When I do something like this: grep "hello" /home/paul/* It works. But when I do something like this: grep "hello" "/home/paul/*" grep display the error: grep: /home/paul/*: No such file or ...
paul's user avatar
  • 495
-2 votes
2 answers
3k views

Grep not working with variables, even with quotes

name=$(echo "$FILENAME" | grep -E '*\.(eng|por|pt-BR)\.*') Why this line doesn't work? if I do echo "Test (2013).1080p.por.mkv" | grep -E "*\.(eng|por)\.*" It works, I tried with "" without " and ...
Freedo's user avatar
  • 1,285
4 votes
4 answers
5k views

How do I invoke jq inside awk?

Essentially I have a file.log as follow blah blah blah blah Hello world | {"foo": "bar"} blah blah Hello earth | {"foo1": "bar1"} Now my goal is to write some shell commands to have desire output ...
Luong Ngoc Son's user avatar
4 votes
3 answers
15k views

How can search for both single quotes and double quotes in a grep search?

When I do a search bindkey in the zsh plugins directory for key conflicts I get responses from both the .zsh script files and .md files, and some of the zsh readme files use a double quote in the ...
vfclists's user avatar
  • 7,619
4 votes
3 answers
12k views

Escape [ in grep

I read strings from stdin and I want to display the users that match the strings. Problem is, if the user inputs the character '[', or a string containing it. grep -F does not work because the line ...
Tigrex's user avatar
  • 53
5 votes
4 answers
10k views

Backslash usage in different commands

I have been trying to get a better understanding of how backslash is used in certain commands. I understand its usage for escaping special characters (Such as echo 'that'\''s no moon' ), but the ...
user217282's user avatar
1 vote
3 answers
943 views

Why doesn't grep return what I expect when I use single quotes

I have a file with the below contents: sh-4.2$ cat file1 example of multiple pattern this is an example of multipole sorry multiple pattern matching using grep so the example is the file itself -...
Pankaj Pandey's user avatar
0 votes
4 answers
2k views

grep syntax for searching strings with single-quotes?

So, I have a .js file as below and I am trying to search with the below grep pattern. I am not sure what mistake I did but it does not give any output even though the file has that pattern. What ...
Iamnoone's user avatar

15 30 50 per page