You are not logged in.

#1 2016-10-13 00:47:43

tatay99
Member
Registered: 2016-10-13
Posts: 2

Issues using grep command after update

Hi there,

  After updating yesterday everything was fine, but today i noticed that whenever i use the grep command, it doesn't do anything.... i mean it doens't output anything.
    For example, if i type:
               $ grep hello
      the cursor just keeps blinking forever and shows no output so i have to Ctrl+C  or  Ctrl+Z to stop the process

   by mere curiosity i used the 'type' command

     $ type grep

and got this output:

     grep is hashed (/usr/bin/grep)

i have no idea what this could be... any help will be appreciated smile

Last edited by tatay99 (2016-10-13 00:49:29)

Offline

#2 2016-10-13 01:18:55

teckk
Member
Registered: 2013-02-21
Posts: 590

Re: Issues using grep command after update

See man grep

grep hello

Won't do anything. There is no file or input to search.

Examples:

grep hello file.txt

ip addr | grep lo

ps -e | grep gvfs

echo "hello" | grep -o h

Offline

#3 2016-10-13 01:25:55

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,571
Website

Re: Issues using grep command after update

Well it will do something - it will accept any input lines you type, and it will echo back those that contain the word hello.  It will continue to do so until it gets an EOF (Ctrl-D) or is killed.  But yes, this question seems to stem from a misuse/misundertanding of grep.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2016-10-13 06:31:33

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: Issues using grep command after update

tatay99 wrote:

[...] or Ctrl+Z to stop the process

Note that ^Z will not stop the process, just suspend it (you can lists suspended/backgrounded jobs for a shell with the `jobs` command).
You can then either use `fg` or `bg` to continue the process in the foreground or background (this article might help you understand that).


pkgs │ hacks │ cfg │ blag

Offline

#5 2016-10-14 00:14:22

tatay99
Member
Registered: 2016-10-13
Posts: 2

Re: Issues using grep command after update

Guys i'm so embarrassed...i've read your comments and as 'Trilby' said, it was a misunderstanding i had regarding the grep command... next time i will read carefully the man pages before asking any dumb question. Anyway thaks for your support and advises, i appreciate it smile i'll go and read the article ayekat suggested smile

Offline

#6 2016-10-14 17:33:46

alex.theoto
Member
From: Athens Greece
Registered: 2014-11-30
Posts: 307

Re: Issues using grep command after update

And don't forget to mark your thread as [SOLVED]

Offline

Board footer

Powered by FluxBB