[opensuse-factory] Problem using echo "blacklist foobar" erases the previous contents of a file
Hello all, I'm having some odd results when using echo command. As you know /etc/modprobe.d/50-blacklist.conf is full of entries. When I open konsole, I type: su - then echo "blacklist nouveau" > /etc/modprobe.d/50-blacklist.conf and I check using cat /etc/modprobe.d/50-blacklist.conf I only see blacklist nouveau The previous entries of the 50-blacklist.conf file have been erased. So I then try: echo "blacklist foobar" > /etc/modprobe.d/50-blacklist.conf Now blacklist nouveau has been overwritten with blacklist foobar. Bizarre. Roman -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Am 22.05.2015 um 22:28 schrieb Roman Bysh:
Hello all,
I'm having some odd results when using echo command. As you know /etc/modprobe.d/50-blacklist.conf is full of entries.
When I open konsole, I type: su - then
echo "blacklist nouveau" > /etc/modprobe.d/50-blacklist.conf
and I check using cat /etc/modprobe.d/50-blacklist.conf I only see
blacklist nouveau
The previous entries of the 50-blacklist.conf file have been erased. So I then try:
echo "blacklist foobar" > /etc/modprobe.d/50-blacklist.conf
Now blacklist nouveau has been overwritten with blacklist foobar.
Bizarre.
Roman
Try this: echo "blacklist foobar" >> /etc/modprobe.d/50-blacklist.conf Take notion of the double ">". Greetings -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Roman Bysh writes:
I'm having some odd results when using echo command. As you know /etc/modprobe.d/50-blacklist.conf is full of entries.
When I open konsole, I type: su - then
echo "blacklist nouveau" > /etc/modprobe.d/50-blacklist.conf
and I check using cat /etc/modprobe.d/50-blacklist.conf I only see
blacklist nouveau
Maybe you should rather use echo "blacklist nouveau" >> /etc/modprobe.d/50-blacklist.conf instead? Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Factory and User Sound Singles for Waldorf Q+, Q and microQ: http://Synth.Stromeko.net/Downloads.html#WaldorfSounds -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 05/22/2015 04:34 PM, Achim Gratz wrote:
Roman Bysh writes:
I'm having some odd results when using echo command. As you know /etc/modprobe.d/50-blacklist.conf is full of entries.
When I open konsole, I type: su - then
echo "blacklist nouveau" > /etc/modprobe.d/50-blacklist.conf
and I check using cat /etc/modprobe.d/50-blacklist.conf I only see
blacklist nouveau
Maybe you should rather use
echo "blacklist nouveau" >> /etc/modprobe.d/50-blacklist.conf
instead?
Regards, Achim.
Doh!! Thank's guys. Time for another pot of coffee. ;-) Cheers! Roman -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Friday 2015-05-22 22:39, Roman Bysh wrote:
Maybe you should rather use
echo "blacklist nouveau" >> /etc/modprobe.d/50-blacklist.conf
instead?
Doh!! Thank's guys. Time for another pot of coffee. ;-)
If one pot did not do it, a second one won't fix it either. I mean, I like the hacker spirit of it (recollect: "real hackers use vi; no, real men use ed; no, real men use >/cat/tail; etc."), but realistically, using a boring normal editor would be faster and more to the user expectation of the final file result. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Fri, May 22, 2015 at 6:08 PM, Jan Engelhardt <jengelh@inai.de> wrote:
On Friday 2015-05-22 22:39, Roman Bysh wrote:
Maybe you should rather use
echo "blacklist nouveau" >> /etc/modprobe.d/50-blacklist.conf
instead?
Doh!! Thank's guys. Time for another pot of coffee. ;-)
If one pot did not do it, a second one won't fix it either.
I mean, I like the hacker spirit of it (recollect: "real hackers use vi; no, real men use ed; no, real men use >/cat/tail; etc."), but realistically, using a boring normal editor would be faster and more to the user expectation of the final file result.
Indeed.. plus if this is a larger program..in this day and age there are nicer things than the shell to use..python and ruby are there for your enjoyment ;-) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Fri, 22 May 2015 16:28:13 -0400 Roman Bysh wrote:
The previous entries of the 50-blacklist.conf file have been erased. So I then try:
echo "blacklist foobar" > /etc/modprobe.d/50-blacklist.conf
Now blacklist nouveau has been overwritten with blacklist foobar.
You, possibly, want to set "noclobber" in the environment. http://www.linuxhowtos.org/tips%20and%20tricks/protecting%20files%20with%20n... -- WBR Kyrill
On 05/23/2015 06:41 PM, Kyrill Detinov wrote:
On Fri, 22 May 2015 16:28:13 -0400 Roman Bysh wrote:
The previous entries of the 50-blacklist.conf file have been erased. So I then try:
echo "blacklist foobar" > /etc/modprobe.d/50-blacklist.conf
Now blacklist nouveau has been overwritten with blacklist foobar.
You, possibly, want to set "noclobber" in the environment. http://www.linuxhowtos.org/tips%20and%20tricks/protecting%20files%20with%20n...
Very nice. Interesting and safe way to prevent overwriting. Cheers! Roman -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
participants (6)
-
Achim Gratz
-
Cristian Rodríguez
-
Fabian Niepelt
-
Jan Engelhardt
-
Kyrill Detinov
-
Roman Bysh