However, benefit of the doubt granted that this isn't some kind of homework problem, then a script such as
If you want to keep the "old" copies of the files too, just remove the "rm" and "mv" lines from the script.
Hi all,
can any one suggest me the script to grep multiple strings from ps -ef
pls correct the below script . its not working/
i want to print OK if all the below process are running in my solaris system. else i want to print NOT OK.
bash-3.00$ ps -ef | grep blu
lscpusr 48 42 ... (11 Replies)
Hello All...
I have a text file (.ics) which I need to read into a variable but ONLY the part including and after 'BEGIN:VEVENT' and ending with END:VEVENT
Anything before BEGIN:VEVENT or after END:VEVENT should be ignored.
Thanks for input
Jeff
BEGIN:VCALENDAR
VERSION:2.0... (3 Replies)
How do I use awk to find the records in a file that contains two specific strings?
I have tried piping and using awk two times, but I don't know how to do it in one action. (2 Replies)
i have 12 files.in all the files the first line will be like:
H|20111213 09:23:00|267628|617
I need to replace that with current date:
H|20111217 09:23:00|267628|617
Like this i need to do it for all the files.
One way i can think is inside a loop, use the below code
a=`sed... (1 Reply)
i'm trying to figure out the easiest way to replace a string:
pineapple pineapple-reg
basketball basketball-reg
football foot-reg-ball
i'm storing the above in a file called wordstoreplace.txt
for each line above, the word in the first column is to be replaced by the word in the second... (4 Replies)
hi,
i am having a certain files in a folder where i need to replace the extension with similar file name
for eg
1.csv
2.csv
3.csv
4.csv
i need to replace the extension
1.csv
1.txt
2.csv
2.txt
3.csv
3.txt (3 Replies)
My OS is Windows 10 and I am using Cygwin.
The file 1 content is:
USE solution 2; -4.000
USE solution 3; -4.000
…
USE solution 29; -4.000
USE solution 30; -4.000
USE solution 31; -4.000
….
USE solution 89; -4.000
...
USE solution 202; -4.000
etc...
I need to replace... (8 Replies)
Hello,
My aim is to search string1 in all lines. When found, find and replace string2 by string3 if possible.
TextFile:
Here is my first line
Second line with string1 & string2
Not last line but it contains string1
Expected output:
Here is my first line
The second line with string1 &... (6 Replies)
Hello,
This is a bit complicated for me.
My scenario in MyFile:
Search string1,
When string1 is found, grep the line containing string1, go back over that line in upward direction and grep the first line containing string2.
Here is an example:
MyFile
His email address... (17 Replies)
I found this in the forum that searches a file for string1, substitute all occurrences of string2 with string3.
(Title: Replace string2 by string3 where string1 is found in line)
>> sed -i '/string1/s/string2/string3/g' TextFile
How will I perform the same sed command and only substitute... (3 Replies)
Discussion started by: apalex
3 Replies
LEARN ABOUT 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
/sys/src/cmd/tr.c
SEE ALSO sed(1)TR(1)