LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   rediraction of data entry (https://www.linuxquestions.org/questions/linux-newbie-8/rediraction-of-data-entry-804358/)

ovod88 04-26-2010 03:41 PM

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?

Tinkster 04-26-2010 04:06 PM

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

ovod88 04-26-2010 04:14 PM

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)))

catkin 04-26-2010 04:19 PM

Quote:

Originally Posted by ovod88 (Post 3948550)
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

ovod88 04-26-2010 04:24 PM

Thanks. This is what I wanted


All times are GMT -5. The time now is 08:48 PM.