02-26-2015
Do you have read/write access to the files and the directories? sed -i writes to a temporary file behind the scenes.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am trying to read 2 files and writing to the 3rd file if I find the same elements in 2 files. my first file is
1 0 kb12124819 766409 1.586e-01
1 0 kb17160939 773886 8.674e-01
1 0 kb4475691 836671 8.142e-01
1 0 ... (2 Replies)
Discussion started by: ezhil01
2 Replies
2. Shell Programming and Scripting
find . -type f -name "*.sql" -print|xargs perl -i -pe 's/pattern/replaced/g'
this is simple logic to find and replace in multiple files & folders
Hope this helps.
Thanks
Zaheer (0 Replies)
Discussion started by: Zaheer.mic
0 Replies
3. Shell Programming and Scripting
Hi, I hope the title does not scare people to look into this thread but it describes roughly what I'm trying to do. I need a solution in PHP.
I'm a programming beginner, so it might be that the approach to solve this, might be easier to solve with an other approach of someone else, so if you... (0 Replies)
Discussion started by: lowmaster
0 Replies
4. Shell Programming and Scripting
Hello All
I have a xml file with many sets of records
like this
<mytag>mydata</mytag>
<tag2>data&</tag2>
also same file can be like this
<mytag>mydata</mytag>
<tag2>data&</tag2>
<tag3>data2&data3</tag3>
Now i can grep & and replace with & for whole file but it will replace all... (4 Replies)
Discussion started by: lokaish23
4 Replies
5. Red Hat
hi there,
Would you able to advise that why the syntax or statement below couldn't work as expected ?
/usr/bin/find /backup -name "*tar*" -mtime +2 -exec /bin/rm -f {} \; 1> /dev/null 2>&1
In fact, I was initially located it as in crontab job, but it doesn't work at all. So, I was... (9 Replies)
Discussion started by: rauphelhunter
9 Replies
6. Shell Programming and Scripting
Hi,
I'm working with gawk (on DOS) today.
A goal is: find a string for-instance '123', cut a line in two columns and write second one. The problem is: command line works OK, awk file doesn't. But I would like to work with file because there are many strings to find.
input:
line command:
awk... (4 Replies)
Discussion started by: frajer
4 Replies
7. Shell Programming and Scripting
Hi, I have text file abc.txt. In this file, I have the following data.
Input:
Mr Smith & Mrs Smith
Mr Smith &apos Mrs Smith
Mr Smith & Mrs Smith
Mr Smith& Mrs Smith
Mr Smith &Mrs Smith
Output:
Mr Smith & Mrs Smith
Mr Smith &apos Mrs Smith
Mr Smith & Mrs Smith
Mr Smith&... (4 Replies)
Discussion started by: naveed
4 Replies
8. Shell Programming and Scripting
cat file1.txt
field1 "user1":
field2:"data-cde"
field3:"data-pqr"
field4:"data-mno"
field1 "user1":
field2:"data-dcb"
field3:"data-mxz"
field4:"data-zul"
field1 "user2":
field2:"data-cqz"
field3:"data-xoq"
field4:"data-pos"
Now i need to have the date like below.
i have just... (7 Replies)
Discussion started by: ckaramsetty
7 Replies
9. Shell Programming and Scripting
Hello people!
I would like to create one script following this stage
I have one directory with 100 files
File001
File002
...
File100
(This is the format of content of the 100 files)
2012/03/10 12:56:50:221875936 1292800448912 12345 0x00 0x04 0
then I have one... (0 Replies)
Discussion started by: Abv_mx81
0 Replies
10. Shell Programming and Scripting
Hi All,
Do you have any sample script,
- auto get file from SFTP remote server and delete file in remove server after downloaded.
- only download specify filename
- auto upload file from local to SFTP remote server and delete local folder file after uploaded
- only upload specify filename
... (3 Replies)
Discussion started by: weesiong
3 Replies
LEARN ABOUT DEBIAN
stg-refresh
STG-REFRESH(1) StGit Manual STG-REFRESH(1)
NAME
stg-refresh - Generate a new commit for the current patch
SYNOPSIS
stg refresh [options] [<files or dirs>]
DESCRIPTION
Include the latest work tree and index changes in the current patch. This command generates a new git commit object for the patch; the old
commit is no longer visible.
You may optionally list one or more files or directories relative to the current working directory; if you do, only matching files will be
updated.
Behind the scenes, stg refresh first creates a new temporary patch with your updates, and then merges that patch into the patch you asked
to have refreshed. If you asked to refresh a patch other than the topmost patch, there can be conflicts; in that case, the temporary patch
will be left for you to take care of, for example with stg squash.
The creation of the temporary patch is recorded in a separate entry in the patch stack log; this means that one undo step will undo the
merge between the other patch and the temp patch, and two undo steps will additionally get rid of the temp patch.
OPTIONS
-u, --update
Only update the current patch files.
-i, --index
Instead of setting the patch top to the current contents of the worktree, set it to the current contents of the index.
-p PATCH, --patch PATCH
Refresh (applied) PATCH instead of the top patch.
-e, --edit
Invoke an editor for the patch description.
-a NOTE, --annotate NOTE
Annotate the patch log entry.
-m MESSAGE, --message MESSAGE
Use MESSAGE instead of invoking the editor.
-f FILE, --file FILE
Use the contents of FILE instead of invoking the editor. (If FILE is "-", write to stdout.)
--sign
Add a "Signed-off-by:" to the end of the patch.
--ack
Add an "Acked-by:" line to the end of the patch.
--author "NAME <EMAIL>"
Set the author details.
--authname NAME
Set the author name.
--authemail EMAIL
Set the author email.
--authdate DATE
Set the author date.
STGIT
Part of the StGit suite - see linkman:stg[1]
StGit 03/13/2012 STG-REFRESH(1)