You are not logged in.
Hello there,
I feel kinda strange, after 20 years of unix/linux experience i finally cannot grasp this problem and need to
post a newbies question :-) Oh well, we can always learn smething new
Running latest Arch Linux, bash, and everytime i run a command piping the output to another command
results in command not found ..
What is happening?
tim@jarabi:~$ cat /etc/passwd | grep tim
bash: grep: command not found
tim@jarabi:~$ which grep
/usr/bin/grep
tim@jarabi:~$ sudo dmesg -T | less
bash: less: command not found
tim@jarabi:~$ which more
/usr/bin/less
tim@jarabi:~$ sudo lsblk | more
bash: more: command not found
tim@jarabi:~$ which more
/usr/bin/more
Offline
There is a weird whitespace after the pipe symbol which resolves the command afterwards to
␣grepCan you test another keyboard?
Offline
There is a weird whitespace after the pipe symbol which resolves the command afterwards to
␣grepCan you test another keyboard?
Did that, Same problem
Offline
What happens if you use the absolute path:
ls -R ~/videos | /usr/bin/grep porn # and inb4 anyone complains to not grep ls, I haven't made a porn reference in like a month, so shut upOffline
As a work around you can remove the spaces and still use pipe in many cases such as:
$ cat /etc/passwd|grep tim
# dmesg -T|lessOffline
I don't even see that "weird whitespace" and copypasting the post into hexdump -C just shows 0x20 either.
Offline
The space is in the error message from bash. The OP gave an *attempt* at diagnostics with "which more", but whiches should be burned at the stake. A relevant diagnostic would be "type more" - I'd wager this will show that it is an alias. And I'd further wager that the OP has a set of alias's that add whitespace for common commands (probably something to do with using with sudo, but I've not used that tool in a long time). And finally I'd wager they copy-pasta'd these aliases from a website into a shell config file.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
![]()
There's indeed a second 0x20, but
$ alias grep=' grep'
$ which grep
/usr/bin/grep # so which is useless
$ type -a grep
grep ist ein Alias von » grep«.
grep ist /usr/bin/grep
grep ist /sbin/grep
grep ist /usr/sbin/grep
# but
$ echo foo | grep foo
foo # bash seems unimpressedBecause of the pipe my money would have been on the subshell screwing $PATH - we'll see.
Offline
It seems by selecting another keyboard layout it was solved from Belgian (alt) to Belgian ...
Offline
That does not seem overly likely - your OP has that stray blank, but the bar is normal.
What display server and desktop environment is this?
What does "xev -event keyboard" print for the bogus(?) layout when entering "a|b"?
Offline