LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-22-2007, 03:28 PM   #1
superandrzej
Member
 
Registered: Nov 2003
Posts: 63

Rep: Reputation: 15
Question Changing the content of already existing file


I want to change the content of already existing file:

No file.
File is created:
#echo "test" > ~/test.txt


cannot change the content:
#echo "test2" > ~/test.txt
-bash: /home/andy/test.txt: cannot overwrite existing file

Does anyone know how to overcome this?
 
Old 01-22-2007, 04:02 PM   #2
MOS JEFF-INITELY
Member
 
Registered: Sep 2006
Distribution: Windows .. MUAHAHAHA
Posts: 66

Rep: Reputation: 15
check your permissions. Check your umask. umask is used to set default permissions on files, so if a umask is 022 the chmod equivalent is 755 or rwx r-x r-x.

ease-e
 
Old 01-22-2007, 04:02 PM   #3
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 7,534

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
Try running
Code:
set +o noclobber
. Your shell seems to have set "noclobber" to prevent overwriting existing files using redirection operators (the > is a redirection operator). Check your scripts to see where "set -o noclobber" was (unintentionally?) set.

Eric
 
Old 02-02-2007, 09:06 AM   #4
superandrzej
Member
 
Registered: Nov 2003
Posts: 63

Original Poster
Rep: Reputation: 15
Smile

Thanks AlienBob,

you are right
in .bashrc I had "set -o noclobber" which I put looong time ago and I've forgotten the meaning of this.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
shell script for changing a txt file content Flobsi Linux - Newbie 3 10-06-2006 03:10 AM
GRUB content changing appasamy Linux - Software 4 09-23-2005 09:55 AM
changing the size of an existing swap partition toolmania1 Linux - Newbie 5 06-16-2005 07:20 PM
Changing Distros and Saving Existing Data ewto Linux - Newbie 1 01-22-2004 05:17 PM
Changing a Linux Distribution on an existing dual boot setup. JevidL Linux - General 4 08-30-2003 11:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:07 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration