On 17Aug2018 00:17, Todd Chester <toddandma...@zoho.com> wrote:
grep and sed stopped working!  I dnf re-installed them
both. No joy

What the heck (not my "actual" word)?
[...]

Next time this happens consider snapshotting the output at various points:

 $ echo "a-b-c" | tee echo.out | ( set -x; sed -e 's/-//g' ) 2>sed-trace.out | 
tee sed.out
 <nothing>

Then "od -c" the echo.out and sed-trace.out and sed.out files.

There's all sorts of possibilities, including the "-" not being an ASCII minus and weird escape sequences hiding the output, not to mention possible stdio bugs in sed or grep - I certainly came across one in GNU sed several years ago for input data.

Just something to keep in mind for later.

Cheers,
Cameron Simpson <c...@cskk.id.au>


$ echo "a-b-c" | sed -e 's/-//g'
<nothing>

Workaround:
   $ echo "a-b-c" | perl -pe 's/-//g'
   abc

   $ echo "a-b-c" | perl6 -pe 's:g/\-//'
   abc



$ ls -al /tmp | sed -n 3,4p
<nothing>

Workaround:
   $  ls -al /tmp  | perl6 -ne ".say if 3 <= ++$ <= 4"
   dr-xr-xr-x. 19 root root    278 Apr 11 20:43 ..
   drwxr--r--.  2 todd users    40 Aug 17 00:08 ARI

   $ x=3; y=4; ls -al /tmp  | perl6 -ne ".say if $x <= ++$ <= $y"
   dr-xr-xr-x. 19 root root    278 Apr 11 20:43 ..
   drwxr--r--.  2 todd users    40 Aug 17 00:08 ARI



# echo "abc" | grep  "ab"
<nothing>

Work around:
   $ echo "abc" | ack "ab"
   abc
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org/message/RG6O4SM24MHTTYZDGM2OIUMSFTJZDMZD/

Reply via email to