wc and modprobe

8 respuestas [Último envío]
Triqel
Desconectado/a
se unió: 12/06/2014

I just noticed that wc command does not work correctly in Trisquel 7. It has linked with modprobe. My example is shown below:

user@trisquel:~$ which wc
/usr/bin/wc

user@trisquel:~$ which modprobe
/sbin/modprobe

user@trisquel:~$ wc -l
modprobe: invalid option -- 'l'

user@trisquel:~$ wc --help
Usage:
modprobe [options] [-i] [-b] modulename
modprobe [options] -a [-i] [-b] modulename [modulename...]
modprobe [options] -r [-i] modulename
modprobe [options] -r -a [-i] modulename [modulename...]
modprobe [options] -c
modprobe [options] --dump-modversions filename
...

Magic Banana

I am a member!

I am a translator!

Desconectado/a
se unió: 07/24/2010

Weird. On an installed system that is up to date (you apparently use a live system), 'wc -l' properly reads the standard input... although I do not see much point in this behavior when the standard input is not redirected (i.e., when it is the keyboard). Is 'wc -l' properly working when you pipe text into it?

marioxcc
Desconectado/a
se unió: 08/13/2014

“wc -l” reads from standard input and outputs a single line containing the number of newline characters read. It's useful to count lines of code, but SLOCCount is specialized for that. I sometimes compare the output of “wc” with that of “sloccount”.

Triqel: Try “ls -li $(which wc) $(which modprobe)” to see if they are hardlinks of each other. Maybe you are experiencing disk corruption. Is there more erroneous behavior that would support this hypotesis?.

Edit 2015-03-11 16:29 (UTC): Formatting.

Triqel
Desconectado/a
se unió: 12/06/2014

Originally, the problem appeared when I tried to check the total number of lines using wc command.

user@trisquel:~$ cat file.txt | wc -l
modprobe: invalid option -- 'l'

This is output for marioxcc:

user@trisquel:~$ ls -li $(which wc) $(which modprobe)
261530 lrwxrwxrwx 1 root root 9 Apr 10 2014 /sbin/modprobe -> /bin/kmod
1025 -rwxr-xr-x 1 root root 42352 Jan 14 05:50 /usr/bin/wc

I use Trisquel 7 Mini with the latest updates. The system has not started with a live media.

Magic Banana

I am a member!

I am a translator!

Desconectado/a
se unió: 07/24/2010

On my system (up-to-date Trisquel 7), 'wc' only takes 39648 bytes:

$ ls -li /usr/bin/wc
4664 -rwxr-xr-x 1 root root 39648 janv. 14 01:50 /usr/bin/wc

Following marioxcc's idea, take a look at the SMART data and auto-test the disk. To do so, you can use the "Disks" utility in the "System settings" (the button in the top-right corner of the window is the menu).

Triqel
Desconectado/a
se unió: 12/06/2014

I did SMART tests/checks without errors using gnome-disks utility. The result of the Overall Assessment was "Disk is OK". Root partition uses ext4 filesystem.

Magic Banana

I am a member!

I am a translator!

Desconectado/a
se unió: 07/24/2010

Try to reinstall the "coreutils" package.

Triqel
Desconectado/a
se unió: 12/06/2014

I reinstalled coreutils package but the result is still same.

user@trisquel:~$ sudo apt-get install --reinstall coreutils

Reading package lists... Done
Building dependency tree
Reading state information... Done
0 to upgrade, 0 to newly install, 1 reinstalled, 0 to remove and 0 not to upgrade.
Need to get 1,089 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://es.archive.trisquel.info/trisquel/ belenos-updates/main coreutils amd64 8.21-1ubuntu5.1 [1,089 kB]
Fetched 1,089 kB in 8s (122 kB/s)
(Reading database ... 212112 files and directories currently installed.)
Preparing to unpack .../coreutils_8.21-1ubuntu5.1_amd64.deb ...
Unpacking coreutils (8.21-1ubuntu5.1) over (8.21-1ubuntu5.1) ...
Processing triggers for install-info (5.2.0.dfsg.1-2) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up coreutils (8.21-1ubuntu5.1) ...

usere@trisquel:~$ wc -l
modprobe: invalid option -- 'l'

marioxcc
Desconectado/a
se unió: 08/13/2014

I suspect that the source package for “wc” (it should be coreutils) may actually have modprobe instead. Maybe it was an error when it was packaged. I haven't checked.