|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Perl one liner to replace text
Not quite a unix question but problem in a perl command. Taking a chance if someone knows about the error Code:
cat 1 a b c d perl -p -e 's/a/b/g' 1 b b c d What is the problem here?? Code:
perl -p -i -e 's/a/b/g' 1 Can't remove 1: Text file busy, skipping file. |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
-i means "in place" But. It requires that the original file be removed and 1 is stdout to perl.
|
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Thanks for replying Jim, prompted by your explanation, I found that the file under consideration is owned by root. A 'user' owned files can be changed by the same command. I tried Code:
sudo chown user 1 no error, but owner is still root. This is very irritating I have 100s of such files to work with. ---------- Post updated at 04:36 PM ---------- Previous update was at 04:04 PM ---------- Thanks I got it sorted, problem was ownership on a mounted directory. |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| replace awk with a perl one liner (REGEXP and FS) | bora99 | Shell Programming and Scripting | 5 | 02-10-2012 09:20 AM |
| perl : replace multiline text between two marker points | rethink | Shell Programming and Scripting | 6 | 01-30-2012 05:04 AM |
| Search & Replace regex Perl one liner to AWK one liner | verge | Shell Programming and Scripting | 9 | 07-07-2011 02:50 AM |
| awk multiple-line search and replace one-liner | louisJ | Shell Programming and Scripting | 8 | 05-07-2011 10:12 PM |
| Replace/Remove not specific text in perl | chriss_58 | Shell Programming and Scripting | 4 | 03-24-2011 08:01 AM |
|
|