07-17-2002
(<ps file output> | <the_sed_command_below...>)
sed '
:loop
$!{
/<<$/{N; s|<<\nNAME>>| **something** |;}
/\\$/t loop
}'
This can be improved upon, but this should get you started.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I have a file that has got carriage returns in it and I want to take them out. Anyone know how I can do this in a ksh?
thanks (4 Replies)
Discussion started by: pitstop
4 Replies
2. UNIX for Dummies Questions & Answers
Is there a command in unix to remove a carriage return character(^M) at the end of a variable value? (5 Replies)
Discussion started by: flagship99
5 Replies
3. Shell Programming and Scripting
Hi, I have a script that outputs a file that contains the dates from the previous month, which is then used by our application to run processes on each date contained in the file. My problem is is that my script created a blank line at the bottom of the file which causes issues for our... (14 Replies)
Discussion started by: bd_joy
14 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I have a situation where I need to remove the carriage return between the lines.
For.eg.
The input file:
1,ad,"adc
sdfd",edf
2,asd,"def
fde",asd
The output file should be
1,ad,adc sdfd,edf
2,asd,def fde,asd
Thanks
Shash (5 Replies)
Discussion started by: shash
5 Replies
5. Shell Programming and Scripting
Hi I would like to add carriage return at end of file,
because we need to mask the customer names for detailed records.
Some what the file doesnot have carriage at end of line of last record.So that i 'll get 2 records when use
---aa.txt-----
1|aaa|bbb|ccc
2|bbbb|hghgh|ggg
000002
tail... (2 Replies)
Discussion started by: HAA
2 Replies
6. UNIX for Advanced & Expert Users
Hi All,
I am getting a xml file where the first field contains a carriage return and the all other fields doesnot contains any carriage return. So all the other records comes in the second line.
<?xml version="1.0" encoding="UTF-8"?>
<ns0:iSeriesCspIntegration... (3 Replies)
Discussion started by: dasj22
3 Replies
7. Shell Programming and Scripting
I want to instert Category:XXXXX into the 2. line
something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong:
sed "2i\\${n}Category:$cat\n"
Sample:
Titel Blahh Blahh abllk sdhsd sjdhf
Blahh Blah Blahh
Blahh
Should look like... (2 Replies)
Discussion started by: lowmaster
2 Replies
8. Shell Programming and Scripting
Hi All,
I am reading two files and writing out the file name and count of lines in each file to an output file.
My script looks like this:
echo "input_file1.out;`wc -l < input_file1.out | sed 's/^]*\(.*\)]*$/\1/'` " > comp_file1.out
echo "input_file2.out;`wc -l < input_file2.out | sed... (2 Replies)
Discussion started by: Hangman2
2 Replies
9. Shell Programming and Scripting
Hi all,
I'm reading a file with this layout:
First_Col Second_Col
The Second_Col has values as 1000, -1, 10, 43...
While reading the file I'm getting the second column value with awk command, but it is including the CR control char.
do
item_saved=`echo $b | awk '{print... (4 Replies)
Discussion started by: mrreds
4 Replies
10. Shell Programming and Scripting
Hi,
I would like to insert the line carriage retrun characters on each line. (2 Replies)
Discussion started by: koti_rama
2 Replies
LEARN ABOUT SUSE
git-cherry-pick
GIT-CHERRY-PICK(1) Git Manual GIT-CHERRY-PICK(1)
NAME
git-cherry-pick - Apply the change introduced by an existing commit
SYNOPSIS
git cherry-pick [--edit] [-n] [-m parent-number] [-s] [-x] [--ff] <commit>
DESCRIPTION
Given one existing commit, apply the change the patch introduces, and record a new commit that records it. This requires your working tree
to be clean (no modifications from the HEAD commit).
OPTIONS
<commit>
Commit to cherry-pick. For a more complete list of ways to spell commits, see the "SPECIFYING REVISIONS" section in git-rev-parse(1).
-e, --edit
With this option, git cherry-pick will let you edit the commit message prior to committing.
-x
When recording the commit, append to the original commit message a note that indicates which commit this change was cherry-picked from.
Append the note only for cherry picks without conflicts. Do not use this option if you are cherry-picking from your private branch
because the information is useless to the recipient. If on the other hand you are cherry-picking between two publicly visible branches
(e.g. backporting a fix to a maintenance branch for an older release from a development branch), adding this information can be useful.
-r
It used to be that the command defaulted to do -x described above, and -r was to disable it. Now the default is not to do -x so this
option is a no-op.
-m parent-number, --mainline parent-number
Usually you cannot cherry-pick a merge because you do not know which side of the merge should be considered the mainline. This option
specifies the parent number (starting from 1) of the mainline and allows cherry-pick to replay the change relative to the specified
parent.
-n, --no-commit
Usually the command automatically creates a commit. This flag applies the change necessary to cherry-pick the named commit to your
working tree and the index, but does not make the commit. In addition, when this option is used, your index does not have to match the
HEAD commit. The cherry-pick is done against the beginning state of your index.
This is useful when cherry-picking more than one commits' effect to your index in a row.
-s, --signoff
Add Signed-off-by line at the end of the commit message.
--ff
If the current HEAD is the same as the parent of the cherry-pick'ed commit, then a fast forward to this commit will be performed.
AUTHOR
Written by Junio C Hamano <gitster@pobox.com[1]>
DOCUMENTATION
Documentation by Junio C Hamano and the git-list <git@vger.kernel.org[2]>.
GIT
Part of the git(1) suite
NOTES
1. gitster@pobox.com
mailto:gitster@pobox.com
2. git@vger.kernel.org
mailto:git@vger.kernel.org
Git 1.7.1 07/05/2010 GIT-CHERRY-PICK(1)