Verdepollo's awk command nearly works. I have altered it slightly. I was not specific enough in that there are also commas throughout the file where they are not needed. This works, but I don't think it is optimal. The log file may sometimes be quite large and it is to be run on an embedded device. Can cpu time be reduced by finding away around the grep command? Thanks again
---------- Post updated at 09:51 PM ---------- Previous update was at 07:49 PM ----------
It seems as though I am having problems. I need to implement this as soft coded configuration, echo'ed into a script. When I do this I lose the quotation marks around "\n" and "string2". This was the main reason I initially preferred a sed command, as it may possibly avoid problems like this. Can anyone give advice on getting round this problem with quotations? To give an example
becomes
and is therefore not working any more.
Can I get around this or do I need to look more towards sed?
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
logs:
"/home/abc/public_html/index.php"
"/home/abc/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
how to use "cut" or "awk" or "sed" to get the following result:
abc
abc
xyz
xyz
xyz (8 Replies)
Hello.
Following recommendations for one of my threads, this is working perfectly :
#!/bin/bash
CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" )
Now I need a grep success for some thing like :
#!/bin/bash
CNT=$( grep -c -e "some text_1... (4 Replies)
I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
LEARN ABOUT OSF1
trbsd
trbsd(1) General Commands Manual trbsd(1)NAME
trbsd - Translates characters
SYNOPSIS
trbsd [-Acs] string1 string2
trbsd -d [-Ac] string1
The trbsd command copies characters from the standard input to the standard output with substitution or deletion of selected characters.
OPTIONS
Translates on a byte-by-byte basis. When you specify this option, trbsd does not support extended characters. Complements (inverts) the
set of characters in string1 with respect to the universe of characters whose codes are 001 through 377 octal if you specify -A, and all
characters if you do not specify -A. Deletes all characters in string1 from output. Changes characters that are repeated output charac-
ters in string2 into single characters.
DESCRIPTION
Input characters from string1 are replaced with the corresponding characters in string2. The trbsd command cannot handle an ASCII NUL
( 00) in string1 or string2; it always deletes NUL from the input.
The tr command is a System V compatible version of trbsd.
Abbreviations such as a-z, standing for a string of characters whose ASCII codes run from character a to character z, inclusive, can be
used to introduce ranges of characters. Note that brackets are not special characters.
Use the escape character (backslash) to remove the special meaning from any character in a string. Use the followed by 1, 2, or 3
octal digits for the code of a character.
If a given character appears more than once in string1, the character in string2 corresponding to its last appearance in string1 will be
used in the translation.
EXAMPLES
To translate braces into parentheses, enter: trbsd '{}' '()' <textfile >newfile
This translates each { (left brace) to a ( (left parenthesis) and each } (right brace) to a ) (right parenthesis). All other char-
acters remain unchanged. To translate lowercase ASCII characters to uppercase, enter: trbsd a-z A-Z <textfile >newfile The two
strings can be of different lengths: trbsd 0-9 # <textfile >newfile
This translates each digit to a # (number sign); if string2 is too short, it is padded to the length of string1 by duplicating its
last character. To translate each string of digits to a single # (number sign), enter: trbsd -s 0-9 # <textfile >newfile To trans-
late all ASCII characters that are not specified, enter: trbsd -c ' -~' 'A-_' <textfile >newfile
This translates each nonprinting ASCII character to the corresponding control key letter ( 01 translates to A, 02 to B, and so
on). ASCII DEL (177), the character that follows ~ (tilde), translates to a ? (question mark).
SEE ALSO
Commands: ed(1), sh(1), tr(1)
Files: ascii(5)trbsd(1)