<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: touch before vi in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/touch-before-vi/m-p/4122008#M314928</link>
    <description>Hi Den:&lt;BR /&gt;&lt;BR /&gt;I suspect that you pre-created (with 'touch') the file such that when you exited the 'vi' session you did not have to first name the file (e.g. 'f myname' then 'wq!').&lt;BR /&gt;&lt;BR /&gt;You circumvent this by starting 'vi' with the name of the file:&lt;BR /&gt;&lt;BR /&gt;# vi myfile&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Fri, 28 Dec 2007 15:42:57 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2007-12-28T15:42:57Z</dc:date>
    <item>
      <title>touch before vi</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/touch-before-vi/m-p/4122005#M314925</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;i've always create my files with touch before vi but i've forgot the reason of this old practice. &lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Den</description>
      <pubDate>Fri, 28 Dec 2007 15:11:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/touch-before-vi/m-p/4122005#M314925</guid>
      <dc:creator>Leo The Cat</dc:creator>
      <dc:date>2007-12-28T15:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: touch before vi</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/touch-before-vi/m-p/4122006#M314926</link>
      <description>Hi ,&lt;BR /&gt;&lt;BR /&gt;There is no advantage in using touch command to create a new file. You may directly use vi to edit a new file without using "touch &lt;FILENAME&gt;".&lt;BR /&gt;&lt;BR /&gt;If all you want is for the file to exist, and donâ  t care if it is empty, you can use the â  touchâ   command.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Srikanth&lt;/FILENAME&gt;</description>
      <pubDate>Fri, 28 Dec 2007 15:27:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/touch-before-vi/m-p/4122006#M314926</guid>
      <dc:creator>Srikanth Arunachalam</dc:creator>
      <dc:date>2007-12-28T15:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: touch before vi</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/touch-before-vi/m-p/4122007#M314927</link>
      <description>I can't remember either for what reason you used a pre-touch?&lt;BR /&gt;Could it be that you wanted to created a file that is only read and writable by the owner,&lt;BR /&gt;as with certain dot files that contain sensitive data such as passwords?&lt;BR /&gt;Maybe something similar to this?&lt;BR /&gt;&lt;BR /&gt;$ (umask 0066; vi ~/.bla.cf)</description>
      <pubDate>Fri, 28 Dec 2007 15:34:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/touch-before-vi/m-p/4122007#M314927</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2007-12-28T15:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: touch before vi</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/touch-before-vi/m-p/4122008#M314928</link>
      <description>Hi Den:&lt;BR /&gt;&lt;BR /&gt;I suspect that you pre-created (with 'touch') the file such that when you exited the 'vi' session you did not have to first name the file (e.g. 'f myname' then 'wq!').&lt;BR /&gt;&lt;BR /&gt;You circumvent this by starting 'vi' with the name of the file:&lt;BR /&gt;&lt;BR /&gt;# vi myfile&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 28 Dec 2007 15:42:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/touch-before-vi/m-p/4122008#M314928</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-12-28T15:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: touch before vi</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/touch-before-vi/m-p/4122009#M314929</link>
      <description>or could be that you used touch to create the file so that another user couldn't come along and create an empty file of the same before you've had a chance to write it using vi.&lt;BR /&gt;&lt;BR /&gt;If user1 runs 'vi foo' and user2 runs 'touch foo' before user1 does ':w' then user2 owns the file that user1 would attempt to be writing to. Right?&lt;BR /&gt;&lt;BR /&gt;-denver&lt;BR /&gt;</description>
      <pubDate>Fri, 28 Dec 2007 16:00:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/touch-before-vi/m-p/4122009#M314929</guid>
      <dc:creator>Denver Osborn</dc:creator>
      <dc:date>2007-12-28T16:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: touch before vi</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/touch-before-vi/m-p/4122010#M314930</link>
      <description>I like Denver reason for doing a touch first. It sort of puts a stake in the ground.&lt;BR /&gt;vi will not pre-create a file, only on (w) exit.&lt;BR /&gt;&lt;BR /&gt;Doing the touch will also from protecting against bing the wrong user for a certain edits. I've been a 'normal' user all too often when trying to edit /etc/group only to find out on exit. (yeah, after extensive edits I just :w ~/tmp and take it from there. (Zelfs een ezel stoot zich, in het gemeen, niet tweemaal aan dezelfde steen. )&lt;BR /&gt;&lt;BR /&gt;$ touch /bin/x&lt;BR /&gt;touch: /bin/x cannot create&lt;BR /&gt;&lt;BR /&gt;It does not protect against no-read/write:&lt;BR /&gt;$ touch x&lt;BR /&gt;$ chmod 0 x&lt;BR /&gt;$ ls -l x&lt;BR /&gt;----------   1 hein       513              0 Dec 28 13:12 x&lt;BR /&gt;$ cat x&lt;BR /&gt;cat: Cannot open x: Permission denied&lt;BR /&gt;$ touch x&lt;BR /&gt;$ ls -l x&lt;BR /&gt;----------   1 hein       513              0 Dec 28 13:13 x&lt;BR /&gt;:&lt;BR /&gt;$vi x&lt;BR /&gt;:wq&lt;BR /&gt;---&amp;gt; "x" Permission denied&lt;BR /&gt;&lt;BR /&gt;fwiw,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 28 Dec 2007 18:23:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/touch-before-vi/m-p/4122010#M314930</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-12-28T18:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: touch before vi</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/touch-before-vi/m-p/4122011#M314931</link>
      <description>Hein had a good useful example.&lt;BR /&gt;&lt;BR /&gt;I use it when I have a file I want to fill up with data, or enter text and give it to someone else, and let them move it to their home directory when I'm done.&lt;BR /&gt;&lt;BR /&gt;$&amp;gt; touch /var/tmp/somefile.txt&lt;BR /&gt;$&amp;gt; chmod g+rw /var/tmp/somefile.txt&lt;BR /&gt;$&amp;gt; chgrp mygrp /var/tmp/somefile.txt&lt;BR /&gt;$&amp;gt; chown someuser /var/tmp/somefile.txt&lt;BR /&gt;$&amp;gt; [ edit file or run process to fill that file , even in background... ]&lt;BR /&gt;&lt;BR /&gt;Then I send them an email telling them where the file is, and tell them to get it, and if it's not gone in 1 hour (some time limit really), it's going to get wiped out.&lt;BR /&gt;&lt;BR /&gt;$&amp;gt; mailx .... (mail them a mesg about file)&lt;BR /&gt;$&amp;gt; at ....  (delete the file in /var/tmp)&lt;BR /&gt;&lt;BR /&gt;If I don't want to use at - I just have a sleep command in front...&lt;BR /&gt;$&amp;gt; nohup (sleep 3600; rm /var/tmp/myfile.txt)  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1 &amp;amp;&lt;BR /&gt;&lt;BR /&gt;This keeps me from having to "sudo" or become a higher power than necessary to give them their requested data, keeps me from having to make publicly readable file (yech), and keeps me from having to "keep tabs" on the file after I've delivered it to a developer.  They quickly learn to get the file when the gettin's good, or lose the file and have to re-request).&lt;BR /&gt;&lt;BR /&gt;Of course, if this is secure data, then this method is not doable, but it works for lots of things.</description>
      <pubDate>Fri, 28 Dec 2007 23:21:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/touch-before-vi/m-p/4122011#M314931</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2007-12-28T23:21:42Z</dc:date>
    </item>
  </channel>
</rss>

