Re: truncating files

1997-12-08 Thread Hamish Moffatt
On Sun, Dec 07, 1997 at 03:05:00PM -0500, Carl Mummert wrote:
 cmrm -f {list of filenames}
 cmtouch {list of filenames}
 
 This doesn't work if you don't have write permission to the
 directory.  The solution should be able to truncate any file
 I have write access to, even if I can't write to the directory.

Are you sure you should be doing this, then?


Hamish
-- 
Hamish Moffatt, [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]
Latest Debian packages at ftp://ftp.rising.com.au/pub/hamish. PGP#EFA6B9D5
CCs of replies from mailing lists are welcome.   http://hamish.home.ml.org


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: truncating files

1997-12-08 Thread Robert D. Hilliard
 From the bash manpage:

   noclobber
  If set, bash does not overwrite  an  existing  file
  with the , , and  redirection operators.  This
  variable may be  overridden  when  creating  output
  files  by using the redirection operator | instead
  of  (see also the -C option  to  the  set  builtin
  command).

Bob

On Sun, 7 Dec 1997,William R Ward [EMAIL PROTECTED] wrote:
  1) I use set -C in bash, so I can't say  foo if foo exists wthout
  first saying set +C.
 
  | foo overrides the noclobber option
 
 Don't you mean !, not |??


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: truncating files

1997-12-07 Thread Krzysztof Adamski
A very simple way is foo (noquotes) works in bash. It also creates a
file.

Krzysztof


On Sat, 6 Dec 1997, Carl Mummert wrote:

 Is there already a (standard) utility on a linux box to truncate a
 file to 0 bytes?  [Besides echo -n   foo, which is 1) too long for
 my lazy fingers and 2) won't take multiple filenames ]
 
 Since I couldn't find one, I wrote a little C program to do it, but I
 am still interested in whether there is already one on the system.
 
 Carl
 
 [EMAIL PROTECTED]
 One must imagine Sysiphus happy
 
 
 --
 TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
 [EMAIL PROTECTED] . 
 Trouble?  e-mail to [EMAIL PROTECTED] .
 


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: truncating files

1997-12-07 Thread William R Ward
-BEGIN PGP SIGNED MESSAGE-

Carl Mummert [EMAIL PROTECTED] writes:
 Is there already a (standard) utility on a linux box to truncate a
 file to 0 bytes?  [Besides echo -n   foo, which is 1) too long for
 my lazy fingers and 2) won't take multiple filenames ]
 
 Since I couldn't find one, I wrote a little C program to do it, but I
 am still interested in whether there is already one on the system.

Other users have suggested the use of  foo, a null command, but
that does not work in tcsh, my preferred shell.  Note that echo  z
does not, as you might expect it to, add a blank line (at least under
tcsh).  So you can save 5 characters from your example that way.

However the way I do this is by doing cp /dev/null foo... I don't
remember why but this is supposedly a better way of doing it.  I think
it preserves the file permissions more accurately?  I am not sure.
I picked that up years ago but have since forgotten the reason...

HTH.

- --Bill.

- -- 
William R Ward  Bay View Consulting   http://www.bayview.com/~hermit/
[EMAIL PROTECTED] 1803 Mission St. #339voicemail +1 408/479-4072
[EMAIL PROTECTED]   Santa Cruz CA 95060 USA   pager +1 408/458-8862

-BEGIN PGP SIGNATURE-
Version: 2.6.2
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface

iQCVAwUBNIo/lR25V7Ur0zHlAQHVUQP/cX0J9D6OFRmON4k4CM8Ah8lmePipA7O6
6nlSc3ibyfbQHAsf3mxhVNOPx/QhBxFafEwFE905OLx5PJQpePIkF12BviQcjP86
/Z4l0VGHIM1fj0Vka6huMx9ShhVLZZHeNMcQq4SM2kDYHX3oWD0LScr3zZadFTMe
MN0hsbhtLXo=
=S+BB
-END PGP SIGNATURE-


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: truncating files

1997-12-07 Thread William R Ward
-BEGIN PGP SIGNED MESSAGE-

Carl Mummert [EMAIL PROTECTED] writes:
 Is there already a (standard) utility on a linux box to truncate a
 file to 0 bytes?  [Besides echo -n   foo, which is 1) too long for
 my lazy fingers and 2) won't take multiple filenames ]
 
 Since I couldn't find one, I wrote a little C program to do it, but I
 am still interested in whether there is already one on the system.

Other users have suggested the use of  foo, a null command, but
that does not work in tcsh, my preferred shell.  Note that echo  z
does not, as you might expect it to, add a blank line (at least under
tcsh).  So you can save 5 characters from your example that way.

However the way I do this is by doing cp /dev/null foo... I don't
remember why but this is supposedly a better way of doing it.  I think
it preserves the file permissions more accurately?  I am not sure.
I picked that up years ago but have since forgotten the reason...

HTH.

- --Bill.

- -- 
William R Ward  Bay View Consulting   http://www.bayview.com/~hermit/
[EMAIL PROTECTED] 1803 Mission St. #339voicemail +1 408/479-4072
[EMAIL PROTECTED]   Santa Cruz CA 95060 USA   pager +1 408/458-8862

-BEGIN PGP SIGNATURE-
Version: 2.6.2
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface

iQCVAwUBNIo/lR25V7Ur0zHlAQHVUQP/cX0J9D6OFRmON4k4CM8Ah8lmePipA7O6
6nlSc3ibyfbQHAsf3mxhVNOPx/QhBxFafEwFE905OLx5PJQpePIkF12BviQcjP86
/Z4l0VGHIM1fj0Vka6huMx9ShhVLZZHeNMcQq4SM2kDYHX3oWD0LScr3zZadFTMe
MN0hsbhtLXo=
=S+BB
-END PGP SIGNATURE-


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: truncating files

1997-12-07 Thread Carl Mummert
Summary:

1)  foo
2) cp /dev/null foo

Problems:

1) I use set -C in bash, so I can't say  foo if foo exists wthout
first saying set +C.

2) cp /dev/null foo won't take multiple filenames as arguments


So teh answer is that I do need a script or program to do the job.

Carl
[EMAIL PROTECTED]
One must imagine Sysiphus happy


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: truncating files

1997-12-07 Thread Rick Macdonald
On Sun, 7 Dec 1997, Carl Mummert wrote:

 Summary:
 
 1)  foo
 2) cp /dev/null foo
 
 Problems:

 2) cp /dev/null foo won't take multiple filenames as arguments

 So the answer is that I do need a script or program to do the job.

What about:

rm -f {list of filenames}
touch {list of filenames}

...RickM...



--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: truncating files

1997-12-07 Thread Carl Mummert
cm 
cm 1)  foo
cm 2) cp /dev/null foo
cm 
cm Problems:
cm
cm 2) cp /dev/null foo won't take multiple filenames as arguments
cm
cm So the answer is that I do need a script or program to do the job.
cm
cmWhat about:
cm
cmrm -f {list of filenames}
cmtouch {list of filenames}

This doesn't work if you don't have write permission to the
directory.  The solution should be able to truncate any file
I have write access to, even if I can't write to the directory.

Otherwise rm -f / touch would be ok.

Carl

[EMAIL PROTECTED]
One must imagine Sysiphus happy



--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: truncating files

1997-12-07 Thread Robert D. Hilliard
 1) I use set -C in bash, so I can't say  foo if foo exists wthout
 first saying set +C.

| foo overrides the noclobber option

Bob


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: truncating files

1997-12-07 Thread hermit

The problem with removing and recreating is that if a program has that
file open for appending (e.g. logfiles), the file isn't actually
removed from the disk until that program closes its file descriptor.
So you end up with 3 problems:
 1. The file still exists on disk, but is not linked to in any
directory;
 2. New log messages are sent to the phantom file, not to your newly
created file - so you never see them; and
 3. You lose the file ownership and permissions of the original
file.

--Bill.

In article [EMAIL PROTECTED], Rick Macdonald [EMAIL PROTECTED] writes:

 On Sun, 7 Dec 1997, Carl Mummert wrote:
 Summary:
 
 1)  foo
 2) cp /dev/null foo
 
 Problems:

 2) cp /dev/null foo won't take multiple filenames as arguments

 So the answer is that I do need a script or program to do the job.

 What about:

 rm -f {list of filenames}
 touch {list of filenames}

 ...RickM...

 -- 
William R Ward  Bay View Consulting   http://www.bayview.com/~hermit/
[EMAIL PROTECTED] 1803 Mission St. #339voicemail +1 408/479-4072
[EMAIL PROTECTED]   Santa Cruz CA 95060 USA   pager +1 408/458-8862


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: truncating files

1997-12-07 Thread hermit
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Robert D. Hilliard) writes:
 1) I use set -C in bash, so I can't say  foo if foo exists wthout
 first saying set +C.

 | foo overrides the noclobber option

Don't you mean !, not |??

--Bill.

-- 
William R Ward  Bay View Consulting   http://www.bayview.com/~hermit/
[EMAIL PROTECTED] 1803 Mission St. #339voicemail +1 408/479-4072
[EMAIL PROTECTED]   Santa Cruz CA 95060 USA   pager +1 408/458-8862


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


truncating files

1997-12-06 Thread Carl Mummert
Is there already a (standard) utility on a linux box to truncate a
file to 0 bytes?  [Besides echo -n   foo, which is 1) too long for
my lazy fingers and 2) won't take multiple filenames ]

Since I couldn't find one, I wrote a little C program to do it, but I
am still interested in whether there is already one on the system.

Carl

[EMAIL PROTECTED]
One must imagine Sysiphus happy


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: truncating files

1997-12-06 Thread Miquel van Smoorenburg
In article [EMAIL PROTECTED],
Carl Mummert [EMAIL PROTECTED] wrote:
Is there already a (standard) utility on a linux box to truncate a
file to 0 bytes?  [Besides echo -n   foo, which is 1) too long for
my lazy fingers and 2) won't take multiple filenames ]

Yeah, just use

 filename

eg, the null command. If you find this unreadable you can also use

:  filename

Since I couldn't find one, I wrote a little C program to do it, but I
am still interested in whether there is already one on the system.

Multiple filenames? for i in *; do :  $i; done

Mike.
-- 
 Miquel van Smoorenburg |  Studying to be a technomage   *
[EMAIL PROTECTED]  | May you live in interesting times


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


RE: truncating files

1997-12-06 Thread Ralph Winslow
Try this one:

foo

or, for multiple file names:

for xxx in *
do
$xxx
done

where * is any regular expression or:

for xxx in a b c d e f g.c h.o g.txt ...
do
$xxx
done

If your finger are lazier than that, I'm afraid I can't help ;-)


On 06-Dec-97 Carl Mummert wrote:
Is there already a (standard) utility on a linux box to truncate a
file to 0 bytes?  [Besides echo -n   foo, which is 1) too long for
my lazy fingers and 2) won't take multiple filenames ]

Since I couldn't find one, I wrote a little C program to do it, but I
am still interested in whether there is already one on the system.

Carl

[EMAIL PROTECTED]
One must imagine Sysiphus happy


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .

-
Ralph Winslow [EMAIL PROTECTED]
The IQ of the group is that of the member
whose IQ is lowest  divided by the number
of members.


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: Big Bad Bug - adduser truncating files from /etc/skel.

1997-06-23 Thread Debian user mail

I reported this a few weeks ago.  Adduser v3.3 should fix this, and should
be forthcoming from Guy Maor.

Pete

--
Peter J. Templin, Jr.   Client Services Analyst
Computer  Communication Services   tel: (717) 524-1590
Bucknell University [EMAIL PROTECTED]


On Sat, 21 Jun 1997, Dave Cinege wrote:

 I finally had the need to add some users to my brand new 1.3.0 server.
 
 Using adduser everything copied from /etc/skel to /home/[user] gets 
 hacked down to one line. 
 
 Don't seem like a 'feature' to me


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . Trouble? 
e-mail to [EMAIL PROTECTED] .


Big Bad Bug - adduser truncating files from /etc/skel.

1997-06-21 Thread Dave Cinege
I finally had the need to add some users to my brand new 1.3.0 server.

Using adduser everything copied from /etc/skel to /home/[user] gets 
hacked down to one line. 

I checked my other machine that was 1.2.6 based and the same thing happened.

.bash_profile:
--
# ~/.bash_profile: executed by bash(1) for login shells.

umask 022
--

becomes:
--
# ~/.bash_profile: executed by bash(1) for login shells.
--

(yes, not good)

.alias:
--
alias   a   alias
alias   loada   'source ~/.alias'
alias   loadalias   loada

alias   log watchlog

unalias ls
alias   ls  'ls-F -C'
alias   lsa 'ls -A'
alias   vdir'ls -l'
alias   vdira   'dir -A'
alias   d   'dir'
alias   da  'dira'
alias   v   'ls -l'
alias   va  'v -A'
alias   pls \\ls

alias   md  mkdir
alias   rd  rmdir
alias   rmold   'rm -rf *~ .*~ #*#'

alias   -   less
alias   +   'less -E'
# alias +   more

alias   f   finger
alias   ff  'finger -l'
alias   p   'ping -c 1'
--

becomes :
--
alias   a   alias
--

Don't seem like a 'feature' to me

--
Elite MicroComputers   908-541-4214  http://www.psychosis.com/emc/


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: Big Bad Bug - adduser truncating files from /etc/skel.

1997-06-21 Thread Dale Scheetz
On Sat, 21 Jun 1997, Dave Cinege wrote:

 I finally had the need to add some users to my brand new 1.3.0 server.
 
 Using adduser everything copied from /etc/skel to /home/[user] gets 
 hacked down to one line. 
 
 I checked my other machine that was 1.2.6 based and the same thing happened.
 
I believe that this was fixed in a more recent version of adduser. What
version are you using?

Dwarf
-- 
_-_-_-_-_-_-  _-_-_-_-_-_-_-

aka   Dale Scheetz   Phone:   1 (904) 656-9769
  Flexible Software  11000 McCrackin Road
  e-mail:  [EMAIL PROTECTED] Tallahassee, FL  32308

_-_-_-_-_-_- If you don't see what you want, just ask _-_-_-_-_-_-_-


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: Big Bad Bug - adduser truncating files from /etc/skel.

1997-06-21 Thread Christian Meder
On Jun 21, Dave Cinege wrote
 I finally had the need to add some users to my brand new 1.3.0 server.
 
 Using adduser everything copied from /etc/skel to /home/[user] gets 
 hacked down to one line. 
 
 I checked my other machine that was 1.2.6 based and the same thing happened.
 

Hi,

upgrade to 3.4 from unstable, will be in 1.3.1:

adduser (3.4) stable unstable; urgency=HIGH

  * fixed behavior when grouphomes=yes (#10422).
  * don't do shell expansion on system() calls (#10425).
  * copy to skel copies entire file (#10399)

 -- Guy Maor [EMAIL PROTECTED]  Tue, 10 Jun 1997 10:45:30 -0500

Greetings,

Christian

-- 
Christian Meder, email: [EMAIL PROTECTED]

What's the railroad to me ?
I never go to see
Where it ends.
It fills a few hollows,
And makes banks for the swallows, 
It sets the sand a-blowing,
And the blackberries a-growing.
  (Henry David Thoreau)


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .