1.
:[^:]*$ here's the confusing bit. So what does this mean? Here's me guessing.
Choose ':' and any character at the beginning of ':' when there are 0 or more occurrences of the preceding character before the end of the line??? I'm sure what I said is wrong but that's a guess.
2.
//; keep doing this on each line till the end of the file?
3.
s/.*:// I think I get this bit. This means any character before the next ':' right?
Please check man SED.
Quote:
Oh, and the first line you gave me gives up to the third ':'. I just want the words before the first ':' for that bit.
hey all,
i was just wondering if it was possible to to get data from user input , and parse it through sed to remove or add what that user has entered into a flat file?
do i need awk ?
any help is greatly appreciated
~shan2on (2 Replies)
hi all,
i want to display output of sar, whichever idle time is less than 30%..i want to add HI and BYE at the starting and ending of the line.
For an example:
sar
Linux 2.6.9-78.0.1.ELsmp (hostname) 07/10/2009
07:10:01 AM CPU %user %nice %system %iowait %idle... (7 Replies)
Hello,
I'm trying to select, or well put the PID that is given by fuser to a var.. It has a wierd format and I somehow can't get it working, any awk/sed experts about?
PID=`fuser $file | awk/sed....?`
if ; then
kill $PID
fi
Greetings and thanks for all your awesome help in advance! (4 Replies)
Hi,
In one of my scripts, I am using sed to do an expression replacement. The code in the script is as under
sed "s|MY_INP_Lab=""|MY_INP_Lab="${2}"|" file1, where $2=xyz_abc_mbk
The EXPECTED output is in file1, all the instances ofMY_INP_Lab="" shall be replaced by... (2 Replies)
Hi all!
I was wondering if anyone could help suggest some solutions to an issue i'm having using the Sed command. I'm still a relative novice at this, but slowly learning and enjoying the power of batch processing.
I am using Sed to extract values from a .txt file containing hundreds of... (2 Replies)
Hi expert,
i need URGENT help in bash shell scripting using sed:
i woud like to search for the word XMLRPC which is at theend of the line below in up2date file. Once found or match
serverURL=https://redhat.com/XMLRPC
replace with myserver.com like this
... (1 Reply)
Hi All,
I am looking for a simple concise solution most likely using sed to process the following 4 rows of data from the same record and only keeps it if the second record satisfy certain critea such as surname matches up to smith or jackson:
John (firstname)
Smith (surname) ... (21 Replies)
I would like to recover the data from 3 text tags.
These three markers are located between the tags specific location <tag1> and </tag1> knowing that they are in many places.
In File.txt:
<tag2>txt2</tag2>
<tag3>txt3</tag3>
<tag4>txt4</tag4>
....
<tag1>
<tag2>txt2</tag2>... (3 Replies)
I am trying to have the user select two files from a numbered list which will eventually be turned into a variable then combined. This is probably something simple and stupid that I am doing.
clear
echo "Please Select the Show interface status file"
select FILE1 in *;
echo "Please Select the... (3 Replies)
Discussion started by: dis0wned
3 Replies
LEARN ABOUT DEBIAN
plan9-tr
TR(1) General Commands Manual TR(1)NAME
tr - translate characters
SYNOPSIS
tr [ -cds ] [ string1 [ string2 ] ]
DESCRIPTION
Tr copies the standard input to the standard output with substitution or deletion of selected characters (runes). Input characters found
in string1 are mapped into the corresponding characters of string2. When string2 is short it is padded to the length of string1 by dupli-
cating its last character. Any combination of the options -cds may be used:
-c Complement string1: replace it with a lexicographically ordered list of all other characters.
-d Delete from input all characters in string1.
-s Squeeze repeated output characters that occur in string2 to single characters.
In either string a noninitial sequence -x, where x is any character (possibly quoted), stands for a range of characters: a possibly empty
sequence of codes running from the successor of the previous code up through the code for x. The character followed by 1, 2 or 3 octal
digits stands for the character whose 16-bit value is given by those digits. The character sequence followed by 1, 2, 3, or 4 hexadecimal
digits stands for the character whose 16-bit value is given by those digits. A followed by any other character stands for that character.
EXAMPLES
Replace all upper-case ASCII letters by lower-case.
tr A-Z a-z <mixed >lower
Create a list of all the words in one per line in where a word is taken to be a maximal string of alphabetics. String2 is given as a
quoted newline.
tr -cs A-Za-z '
' <file1 >file2
SOURCE
/src/cmd/tr.c
SEE ALSO sed(1)TR(1)