Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 13636 - cats are evil
Summary: cats are evil
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All All
: Low trivial
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-10 07:50 UTC by Daniel
Modified: 2003-01-14 00:05 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel 2003-01-10 07:50:59 UTC
i think the team needs to learn how to save some resources by not spawning so
many unnessissary "cat" processes.
(they may also need to man test || man bash)

ALSA Doc:
~~~~~~~~
Code listing 2.3

#cat /proc/pci  | grep audio

should be...
#grep audio /proc/pci


Gentoo FAQ Doc:
~~~~~~~~~~~~~~
Code listing 5.1

# cat /var/log/syslog.d/current | tai64nlocal | less

could be...
# tai64nlocal < /var/log/syslog.d/current | less


rc-scripts:
~~~~~~~~~~
$ grep -R 'cat ' /etc

...
/etc/init.d/hostname:   if [ ! -f /etc/hostname ] || [ -z "$(cat /etc/hostname)" ]
...
/etc/init.d/xfs:                if [ "$(cat $1/fonts.list | md5sum)" != "$(echo
"${fontlist}" | md5sum)" ]
...
/etc/runlevels/boot/serial:     local res="$(cat /proc/modules | egrep 'serial'
| cut -f1 -d" ")"
...

WTF?
Comment 1 Jungmin Seo (RETIRED) gentoo-dev 2003-01-13 18:05:07 UTC
The doc bugs are resolved now.

i'm reposting  this bug.. there are 'rc-scripts' devs who can answer the last one.
Comment 2 SpanKY gentoo-dev 2003-01-13 19:26:46 UTC
/etc/init.d/hostname:   if [ ! -f /etc/hostname ] || [ -z "$(cat /etc/hostname)" ] 
i dont see a problem with this ... i mean the only thing you could change it to would be 
$(</etc/hostname) and that isnt great imo ... 
 
/etc/init.d/xfs:                if [ "$(cat $1/fonts.list | md5sum)" != "$(echo "${fontlist}" | md5sum)" ] 
this is invalid ... i mean the only way to get the outputs to be the same is if you md5sum'ed 
them both from stdin ... yes you could cut/awk the first param out, but that goes along the 
same line of 'why spawn so many XXX processes' ... 
 
/etc/runlevels/boot/serial:     local res="$(cat /proc/modules | egrep 'serial' | cut -f1 -d" ")" 
this could be changed to: 
$(grep serial /proc/modules | awk '{print $1}') 
Comment 3 SpanKY gentoo-dev 2003-01-13 19:28:28 UTC
actually about the hostname one, heres a good reason for changing it from 
$(cat /etc/hostname) to $(</etc/hostname) 
 
`man bash` says: 
The command substitution $(cat file) can be replaced by the equivalent but faster $(< file). 
 
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2003-01-14 00:05:11 UTC
/etc/init.d/hostname:  Fixed

/etc/init.d/xfs: Do not see an issue.

/etc/runlevels/boot/serial:  Its actually /etc/init.d/serial, but fixed anyhow.


I sometimes wish bored people will get something to keep *themselfs* busy, not
make more work for *already* busy other people.