Search Results

Search: Posts Made By: nram_krishna@ya
4,910
Posted By radoulov
There is also the base64 program that's part of...
There is also the base64 program that's part of the GNU coreutils:

$ base64 --help |grep -F -- -d
-d, --decode Decode data.
4,910
Posted By itkamaraj
echo "YOURSTRING" | perl -pe 'use MIME::Base64;...
echo "YOURSTRING" | perl -pe 'use MIME::Base64; print MIME::Base64::decode($_);'
4,910
Posted By yazu
https://www.unix.com/shell-programming-scripting/17...
https://www.unix.com/shell-programming-scripting/17620-decode-email.html
1,517
Posted By yazu
echo 'chris martin 200173 845747 mech...
echo 'chris martin 200173 845747 mech engineerchris' |
sed -r 's/([^0-9]*)([0-9 ]*)([^0-9]*)/var1=\1\nvar2=\2\nvar3=\3/'

GNU sed. Change "(" and ")" to "\(" and "\)" for another one (and remove...
1,184
Posted By michaelrozar17
Then try to pattern match it with command sed....
Then try to pattern match it with command sed. You cannot pattern match as highlighted above.
Still not very clear with your requirement. Please brief again and post the exact contents of variable...
1,650
Posted By bartus11
Assuming "abc" is your pattern: perl -nle 'print...
Assuming "abc" is your pattern: perl -nle 'print "$1 $2" if /(\d+) abc (\d+)/' file
1,650
Posted By shipra_31
echo "1234567890 abc 1234" | awk -F "[a-zA-Z]*"...
echo "1234567890 abc 1234" | awk -F "[a-zA-Z]*" '{print $1 $2}'

if u have the character in a file then
awk -F "[a-zA-Z]*" '{print $1 $2}' sample.txt
where $1 will be before the pattern and $2...
1,650
Posted By bartus11
So you just want to remove digits from the input...
So you just want to remove digits from the input file? If so, try this: sed 's/[0-9]//g' infile > outfile
1,650
Posted By shipra_31
you may try something like this echo "aB12Cd" ...
you may try something like this
echo "aB12Cd" | tr -dc '[a-zA-Z]'
1,489
Posted By Skrynesaver
so you need to check for var1 in var2 with any...
so you need to check for var1 in var2 with any number of spaces randomly inserted?

var1="abc"
var2="a b c def"
pattern=$(echo $var1 |sed 's/\(.\)/\1 */g')
echo $var2|sed "s/^$pattern//"

...
1,489
Posted By michaelrozar17
Here VAR3 holds the "remaining stuffs" from VAR1...
Here VAR3 holds the "remaining stuffs" from VAR1 if it matches VAR2.
VAR1="AB CDEF"
VAR2="ABC"
VAR3=$(echo "$VAR1" | sed -n "s/ //g; s/$VAR2//p")
1,489
Posted By Shell_Life
Is this what you want: echo 'ab cdef' | sed...
Is this what you want:
echo 'ab cdef' | sed 's/ab[ ]*c//'
1,592
Posted By Skrynesaver
could you show us what you actually tried and...
could you show us what you actually tried and explain what you are hoping to find in the file...
2,282
Posted By radoulov
Try this: line='nramak|BFS|121 * 789 *...
Try this:

line='nramak|BFS|121 * 789 * 85#2[123]|7539|'

param4=$(
printf '%s\n' "$line" |
cut -d\| -f3 |
tr ']#[' ' '
)

printf '%s\n' "$param4"
2,282
Posted By radoulov
We'll need to see a sample of your input and an...
We'll need to see a sample of your input and an example of the desired/expected output.
2,282
Posted By radoulov
It's not awk, it's the shell ... You need to...
It's not awk, it's the shell ...
You need to quote the parameters in order to avoid shell filed splitting and filename generation (globbing)!

PARAM4=`echo "$LINE" | nawk -F"|" '{print $4}'
echo...
1,868
Posted By itkamaraj
$ echo $test a b c d e f g $ echo...
$ echo $test
a b c d e f g

$ echo $search_string
abc

$ echo $search_string | while read -n1 char; do test=`echo $test | sed "s/$char//"`; echo $test; done
b c d e f g
c d e f g
d e f g
3,643
Posted By michaelrozar17
Try.. echo 'this too [will [pas]s b[y]' | sed...
Try..
echo 'this too [will [pas]s b[y]' | sed 's/[][]//g'
1,060
Posted By michaelrozar17
echo '-asadjh--nfkdjnf------nfjksnfjkd'|tr -s '-'...
echo '-asadjh--nfkdjnf------nfjksnfjkd'|tr -s '-' ' '
1,060
Posted By bartus11
Try:sed 's/-+/ /g' file
Try:sed 's/-+/ /g' file
53,898
Posted By harish612
Try with below i=0; if [ $i -eq 0 ]; then ...
Try with below

i=0;
if [ $i -eq 0 ]; then
echo inside if
fi


In case you want to debug your script put below code at the very beginning


set -x


Cheers
Harish
9,126
Posted By jlliagre
"tr" can be used instead of "sed" and would...
"tr" can be used instead of "sed" and would likely be faster:
echo '/ and \' | tr -d '\\/'
9,126
Posted By ltomuno
echo '/ and \' | sed 's/[/|\]//g'
echo '/ and \' | sed 's/[/|\]//g'
9,126
Posted By itkamaraj
$ echo "\/" | sed -e 's,\/,,' -e 's,\\,,' $...
$ echo "\/" | sed -e 's,\/,,' -e 's,\\,,'

$ echo "\/"
\/
$
2,815
Posted By ltomuno
echo '85743975945738' | awk '{print...
echo '85743975945738' | awk '{print substr($0,0,4)"-"substr($0,5,4)"-"substr($0,9)}'
Showing results 1 to 25 of 35

 
All times are GMT -4. The time now is 09:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy