LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-26-2010, 03:41 PM   #1
ovod88
Member
 
Registered: Apr 2010
Posts: 53

Rep: Reputation: 15
rediraction of data entry


I have created file "dirlist" using the next command:
ls > dirlist
Then I changed current directory and made the same. When I opened "dirlist" I saw the content of the new current directory. I forbided overwriting by
set -o noclobber
Yep, it works, nothing can be attended to the file but how to revert?
 
Old 04-26-2010, 04:06 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
noblobber is not what you want - it will make the append FAIL
if the file exists.

Just use > for the first redirect, and >> for subsequent ones.


Cheers,
Tink
 
Old 04-26-2010, 04:14 PM   #3
ovod88
Member
 
Registered: Apr 2010
Posts: 53

Original Poster
Rep: Reputation: 15
No, you didnt understand the question. When I used set -o noclobber i forbided overwriting the file, right? But how to make the opposite, to allow to overwrite the file)))
 
Old 04-26-2010, 04:19 PM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by ovod88 View Post
No, you didnt understand the question. When I used set -o noclobber i forbided overwriting the file, right? But how to make the opposite, to allow to overwrite the file)))
Only by output redirection in the shell. The change I think you want is not to the file but to the shell: set +o noclobber
 
Old 04-26-2010, 04:24 PM   #5
ovod88
Member
 
Registered: Apr 2010
Posts: 53

Original Poster
Rep: Reputation: 15
Thanks. This is what I wanted
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Entry, Guys need your help chandannasta General 5 05-11-2008 01:15 PM
Offline Data Entry Ad aphobos General 1 12-24-2007 02:27 AM
web based data entry ScottReed Programming 3 07-10-2006 12:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration