zsh-users
 help / color / mirror / code / Atom feed
* setopt noclobber in /proc-filesystem
@ 2005-08-15 11:14 Michael Prokop
  2005-08-15 14:58 ` Dan Nelson
  2005-08-17 20:51 ` Wayne Davison
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Prokop @ 2005-08-15 11:14 UTC (permalink / raw)
  To: Zsh Users

Hello,

% setopt noclobber
% echo foo > /proc/sys/kernel/hotplug
zsh: file exists: /proc/sys/kernel/hotplug

Is there any chance to use option 'noclobber' but allow writing to
/proc-filesystem anyway? I do know that there exists 'setopt
clobber' ;-) and "echo ... >| /proc/..." as well but other users
might not know this.

I'd like to ship zsh on my live-cd-system with 'setopt noclobber'
enabled but would like to avoid that users think the behaviour in
/proc-fs is a bug.  Any ideas?

regards,
-mika-
-- 
 ,'"`.         http://www.michael-prokop.at/
(  grml.org -» Linux for texttool-users and sysadmins
 `._,'         http://www.grml.org/


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: setopt noclobber in /proc-filesystem
  2005-08-15 11:14 setopt noclobber in /proc-filesystem Michael Prokop
@ 2005-08-15 14:58 ` Dan Nelson
  2005-08-15 21:54   ` Nikolai Weibull
  2005-08-17 10:08   ` Michael Prokop
  2005-08-17 20:51 ` Wayne Davison
  1 sibling, 2 replies; 7+ messages in thread
From: Dan Nelson @ 2005-08-15 14:58 UTC (permalink / raw)
  To: Zsh Users

In the last episode (Aug 15), Michael Prokop said:
> % setopt noclobber
> % echo foo > /proc/sys/kernel/hotplug
> zsh: file exists: /proc/sys/kernel/hotplug
> 
> Is there any chance to use option 'noclobber' but allow writing to
> /proc-filesystem anyway? I do know that there exists 'setopt
> clobber' ;-) and "echo ... >| /proc/..." as well but other users
> might not know this.
> 
> I'd like to ship zsh on my live-cd-system with 'setopt noclobber'
> enabled but would like to avoid that users think the behaviour in
> /proc-fs is a bug.  Any ideas?

sysctl -w kernel.hotplug=foo

-- 
	Dan Nelson
	dnelson@allantgroup.com


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: setopt noclobber in /proc-filesystem
  2005-08-15 14:58 ` Dan Nelson
@ 2005-08-15 21:54   ` Nikolai Weibull
  2005-08-17 10:08   ` Michael Prokop
  1 sibling, 0 replies; 7+ messages in thread
From: Nikolai Weibull @ 2005-08-15 21:54 UTC (permalink / raw)
  To: Zsh Users

Dan Nelson wrote:

> In the last episode (Aug 15), Michael Prokop said:

> > % setopt noclobber
> > % echo foo > /proc/sys/kernel/hotplug
> > zsh: file exists: /proc/sys/kernel/hotplug

> sysctl -w kernel.hotplug=foo

Hahaha, very good solution,
        nikolai

-- 
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: setopt noclobber in /proc-filesystem
  2005-08-15 14:58 ` Dan Nelson
  2005-08-15 21:54   ` Nikolai Weibull
@ 2005-08-17 10:08   ` Michael Prokop
  2005-08-17 10:19     ` Oliver Kiddle
  1 sibling, 1 reply; 7+ messages in thread
From: Michael Prokop @ 2005-08-17 10:08 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 1087 bytes --]

* Dan Nelson <dnelson@allantgroup.com> [20050815 17:15]:
> In the last episode (Aug 15), Michael Prokop said:

> > % setopt noclobber
> > % echo foo > /proc/sys/kernel/hotplug
> > zsh: file exists: /proc/sys/kernel/hotplug

> > Is there any chance to use option 'noclobber' but allow writing to
> > /proc-filesystem anyway? I do know that there exists 'setopt
> > clobber' ;-) and "echo ... >| /proc/..." as well but other users
> > might not know this.

> > I'd like to ship zsh on my live-cd-system with 'setopt noclobber'
> > enabled but would like to avoid that users think the behaviour in
> > /proc-fs is a bug.  Any ideas?

> sysctl -w kernel.hotplug=foo

Hehe, I'd like to find a solution for the zsh-echo->/proc. ;)

*I* do know that I can use sysctl and 'echo >|...' but other users
do *not*. Therefore I need a solution where something like
echo 3 > /proc/acpi/sleep
works out-of-the-box.

regards,
-mika-
-- 
 ,'"`.         http://www.michael-prokop.at/
(  grml.org -» Linux for texttool-users and sysadmins
 `._,'         http://www.grml.org/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: setopt noclobber in /proc-filesystem
  2005-08-17 10:08   ` Michael Prokop
@ 2005-08-17 10:19     ` Oliver Kiddle
  2005-08-17 20:18       ` Michael Prokop
  0 siblings, 1 reply; 7+ messages in thread
From: Oliver Kiddle @ 2005-08-17 10:19 UTC (permalink / raw)
  To: Zsh Users

Michael Prokop wrote:
> 
> *I* do know that I can use sysctl and 'echo >|...' but other users
> do *not*. Therefore I need a solution where something like
> echo 3 > /proc/acpi/sleep
> works out-of-the-box.

The only way to do that would be to modify the C code to check the
filesystem type of the file being written to.

Alternatively, you might want to rethink why you want to impose the
noclobber option on your users. You may like the option but many people,
including myself, find it to be a nuisance.

Oliver


This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: setopt noclobber in /proc-filesystem
  2005-08-17 10:19     ` Oliver Kiddle
@ 2005-08-17 20:18       ` Michael Prokop
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Prokop @ 2005-08-17 20:18 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 828 bytes --]

* Oliver Kiddle <okiddle@yahoo.co.uk> [20050817 12:42]:
> Michael Prokop wrote:

> > *I* do know that I can use sysctl and 'echo >|...' but other users
> > do *not*. Therefore I need a solution where something like
> > echo 3 > /proc/acpi/sleep
> > works out-of-the-box.

> The only way to do that would be to modify the C code to check the
> filesystem type of the file being written to.

Ok, thanks for clarification!

> Alternatively, you might want to rethink why you want to impose the
> noclobber option on your users. You may like the option but many people,
> including myself, find it to be a nuisance.

Yes, that's what I'll do. Thanks!

regards,
-mika-
-- 
 ,'"`.         http://www.michael-prokop.at/
(  grml.org -» Linux for texttool-users and sysadmins
 `._,'         http://www.grml.org/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: setopt noclobber in /proc-filesystem
  2005-08-15 11:14 setopt noclobber in /proc-filesystem Michael Prokop
  2005-08-15 14:58 ` Dan Nelson
@ 2005-08-17 20:51 ` Wayne Davison
  1 sibling, 0 replies; 7+ messages in thread
From: Wayne Davison @ 2005-08-17 20:51 UTC (permalink / raw)
  To: Zsh Users

On Mon, Aug 15, 2005 at 01:14:55PM +0200, Michael Prokop wrote:
> Is there any chance to use option 'noclobber' but allow writing to
> /proc-filesystem anyway?

I can imagine using a preexec() function to examine the command-line
and setting noclobber on or off based on whether it looks like the
command is trying to redirect to a file in /proc.

..wayne..


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-08-17 20:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-15 11:14 setopt noclobber in /proc-filesystem Michael Prokop
2005-08-15 14:58 ` Dan Nelson
2005-08-15 21:54   ` Nikolai Weibull
2005-08-17 10:08   ` Michael Prokop
2005-08-17 10:19     ` Oliver Kiddle
2005-08-17 20:18       ` Michael Prokop
2005-08-17 20:51 ` Wayne Davison

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).