Re: [newbie] Got a question...

2001-07-18 Thread Sridhar Dhanapalan

On Mon, 16 Jul 2001 00:57, Tim Holmes wrote:
> Maybe somebody can shed some light on this subject.
>
> I write a lot of scripts, and I go back and revise them as well.  Well I
> keep noticing files that have a ~ at the end of the file.  For example,
> one of the first scripts I tested when learning expect.
>
> [timh@r2d2 bin]$ ls -la aftp*
> -rwxr-xr-x1 timh timh  142 Jul 15 10:53 aftp*
> -rwxr-xr-x1 timh timh  142 Jul  1 19:45 aftp~*
>
> But the files are the same.
>
> [timh@r2d2 bin]$ diff aftp aftp~
>
> They both look like this.
>
> [timh@r2d2 bin]$ cat aftp
> #!/usr/bin/expect
> log_user 0
> proc domainname {}  {
> set file [open /etc/resolv.conf r]
> while {[gets $file buf] != -1}  {
> if {[scan $buf "domain %s" name] ==1} {
> close $file
> return $name
> }
> }
> close $file
> error "No domain declaration in /etc/resolv.conf"
> }
> spawn ftp $argv
> expect "Name"
> send "anonymous\r"
> expect "Password:"
> send "anon@[domainname]\r"
> log_user 1
> interact
>
> But as soon as I edit it, then close it out, there's a "temp" file there
> and it always ends in ~.  What's this all about?  How long do these files
> stick around?  I've often just gone and removed them, but now I'm real
> curious as to what's the point of them.
>
> Thanks for the help.
> tdh

I believe that they are just backups made automatically by your text editor, 
whenever you save. That way, you have something to go back to if you mess 
your file up.

-- 
Sridhar Dhanapalan.
"There are two major products that come from Berkeley:
LSD and UNIX. We don't believe this to be a coincidence."
-- Jeremy S. Anderson





Re: [newbie] Got a question...

2001-07-16 Thread Jan Wilson

* Tim Holmes <[EMAIL PROTECTED]> [010716 01:20]:
> Well does anybody know how to turn it off in vim?  I've checked the
> .viminfo and I can't see anything in there.  And there's no .vimrc or
> .virc.  Anybody have a clue?
> tdh

In .vimrc:
set nobk

If you don't have one, you should be able to find a sample one in:
/usr/share/vim/vimrc
(in Mdk 8.0).

-- 
Jan Wilson, SysAdmin _/*];  [EMAIL PROTECTED]
Corozal Junior College   |  |:'  corozal.com corozal.bz
Corozal Town, Belize |  /'  chetumal.com & linux.bz
Reg. Linux user #151611  |_/   Network, SQL, Perl, HTML





Re: [newbie] Got a question...

2001-07-15 Thread Tim Holmes

Well does anybody know how to turn it off in vim?  I've checked the
.viminfo and I can't see anything in there.  And there's no .vimrc or
.virc.  Anybody have a clue?
tdh

--
T. Holmes
-
UNIXTECHS.org
[EMAIL PROTECTED]
-
"Real Men Us Vi!"

Uptime:
  
 2:25AM  up 1 day,  4:16, 5 users, load averages: 0.01, 0.01, 0.00
  
| This is a common feature in text editors. In Kedit, for example, this can be 
| toggled in its preferences by (un)checking the box "Make backup when saving a 
| file".
| 
| 
| On Mon, 16 Jul 2001 01:10, Michael D. Viron wrote:
| > Tim,
| >
| > This looks like what happens when you edit something in Joe--it
| > automatically creates a copy of the file being edited as filename~.  This
| > is basically a backup file, and it will stick around until you delete it.
| > I seem to remember reading that there is a way to turn it off in one of
| > joe's config files, but can't remember which one.
| >
| > Michael
  -- 
Your Fortune
LSD melts in your mind, not in your hand.




Re: [newbie] Got a question...

2001-07-15 Thread Michael D. Viron

Tim,

This looks like what happens when you edit something in Joe--it
automatically creates a copy of the file being edited as filename~.  This
is basically a backup file, and it will stick around until you delete it.
I seem to remember reading that there is a way to turn it off in one of
joe's config files, but can't remember which one.

Michael

--
Michael Viron
Registered Linux User #81978
Senior Systems & Administration Consultant
Web Spinners, University of West Florida

At 10:57 AM 07/15/2001 -0400, Tim Holmes wrote:
>Maybe somebody can shed some light on this subject.
>
>I write a lot of scripts, and I go back and revise them as well.  Well I
>keep noticing files that have a ~ at the end of the file.  For example,
>one of the first scripts I tested when learning expect.
>
>[timh@r2d2 bin]$ ls -la aftp*
>-rwxr-xr-x1 timh timh  142 Jul 15 10:53 aftp*
>-rwxr-xr-x1 timh timh  142 Jul  1 19:45 aftp~*
>
>But the files are the same.
>
>[timh@r2d2 bin]$ diff aftp aftp~
>
>They both look like this.
>
>[timh@r2d2 bin]$ cat aftp
>#!/usr/bin/expect
>log_user 0
>proc domainname {}  {
>set file [open /etc/resolv.conf r]
>while {[gets $file buf] != -1}  {
>if {[scan $buf "domain %s" name] ==1} {
>close $file
>return $name
>}
>}
>close $file
>error "No domain declaration in /etc/resolv.conf"
>}
>spawn ftp $argv
>expect "Name"
>send "anonymous\r"
>expect "Password:"
>send "anon@[domainname]\r"
>log_user 1
>interact
>
>But as soon as I edit it, then close it out, there's a "temp" file there
>and it always ends in ~.  What's this all about?  How long do these files
>stick around?  I've often just gone and removed them, but now I'm real
>curious as to what's the point of them.
>
>Thanks for the help.
>tdh
>
>-- 
>T. Holmes
>-
>UNIXTECHS.org
>[EMAIL PROTECTED]
>-
>"Real Men Us Vi!"
>
>Uptime: 
>  
>10:52AM  up 12:43, 3 users, load averages: 0.00, 0.01, 0.00
>  
>   Your Fortune
>   AMAZING BUT TRUE ...
>
>If all the salmon caught in Canada in one year were laid end to end
>across the Sahara Desert, the smell would be absolutely awful.
>