- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Appending file
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2001 08:54 PM
07-10-2001 08:54 PM
Appending file
Is there any way where any user can only append to a file without deleting it or modifying the contents of the file. Just pure adding.
for ex. the .sh_history file is own by the users itself. only the user can modify, add delete the contents other than root. The qts is is there any way where he user can just append to the file without deleting
the contents or modifying it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2001 09:42 PM
07-10-2001 09:42 PM
Re: Appending file
Prolly something like userfile.txt >> otherfile.txt. Im sure there will be more
solutions. And if my ideas is not too good .. Please tell me why !!
thanks
Richard =)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2001 09:56 PM
07-10-2001 09:56 PM
Re: Appending file
forgot that you have to cat the file to append it to the other file so it will look like this
if you have more then one file to append.
cat userfile >> mainfile
cat userfile2 >> mainfile
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2001 10:04 PM
07-10-2001 10:04 PM
Re: Appending file
cat file1 file2 > file3
mv file3 file1
or
cat file2 >> file1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2001 12:02 AM
07-11-2001 12:02 AM
Re: Appending file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2001 02:26 AM
07-11-2001 02:26 AM
Re: Appending file
You could write a script (perferably a C-program), which appends to the given file. Assuming your target file is owned by user xxx who has write permission, but ther is no write permission for other users. Give the script owner xxx and chmod 4755 script, that will set the SETUID bit. (You need to be root or xxx to perform the chmod).
Every user with permission to execute this scrip will be able to append to you target file, but have no other permissions.
Klaus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2001 04:02 AM
07-11-2001 04:02 AM
Re: Appending file
Yes, this can be done. Set the 'noclobber' option. You will be able to append but not to overwrite:
#!/usr/bin/sh
set -o noclobber
typeset F=/tmp/myfile
echo "...appending on...`date`" >> $F
echo "...appending on...`date`" >> $F
echo "...overwriting?...`date`" > $F
#.end.
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2001 05:21 AM
07-11-2001 05:21 AM
Re: Appending file
James is correct. The noclobber option would stop the file accidentally overwritten. However, if security is what your looking for, the noclobber will not do it.
example.
With noclobber on:
echo "test overwrite" > $F # will not overwrite file
However,
echo "test overwrite" >| $F #will overwrite file
If security is what you want, you will need to use the cron answer above.
hope this helps.
...jcd...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2001 12:10 PM
07-11-2001 12:10 PM
Re: Appending file
If security is the issue, you can use third party security softwares to restrict access to files. I had used a software called SeOS from Platinum (2 years back) which can grant access to files as create/append/delete levels per users or group.
Thanks.
Prashant Deshpande.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2001 12:44 PM
07-11-2001 12:44 PM
Re: Appending file
Computer Associates bought Platinum and renamed SeOS to Etrust. It sucks rocks. We're talking great big boulders here. Of course, that's CA.
We have to run Etrust to meet audit requirements. Truthfully, though, I'd rather have my eyeballs eaten-out by rats rather than deal with SeOS any longer.
All the best,
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2001 01:12 PM
07-11-2001 01:12 PM
Re: Appending file
We at that time had only restricted its use for system files and did not go to its full implementation for its very own reasons, I only wanted to suggest to look at different security softwares to serve the purpose of file access restriction.
Prashant Deshpande.