Search Results

Search: Posts Made By: greet_sed
1,053
Posted By greet_sed
Hi, awk -F"[|:-]" ' { print $1 "\t" $2 "\t"...
Hi,

awk -F"[|:-]" ' { print $1 "\t" $2 "\t" $3 "\t" $1 ":" $2 "-" $3 "\t" "." "\t" $4}' file

Gives the desired output:
1,787
Posted By greet_sed
Hi, In sed: echo...
Hi,

In sed:
echo "xy--#growncars#vello--hello3--hello4--jello#growncars#dello--gello--gelloA--gelloB#growncars#" | sed -e 's/.*#growncars#\(.*\)#growncars#\(.*\)#growncars#/\1\n\2/'

Gives...
1,553
Posted By greet_sed
Hi, can you try something like this ? ...
Hi,

can you try something like this ?

tar tf all.tar.gz | grep ".xml" > all-xml-file-list

#if you dont have file list from batch ,create it
rm -f batch-file-list
for i in bat*.tar.gz
do...
13,223
Posted By greet_sed
Hi, IMO, if it is xml file with proper xml...
Hi,

IMO, if it is xml file with proper xml syntax then xmllint is better choice.

Read man xmllint for detailed information.


echo "cat...
6,967
Posted By greet_sed
Hi, It depends on what you have in $5 and...
Hi,


It depends on what you have in $5 and if condition succeeds.
value is sumed up only when if condition is executed.

I tried as follows and looks fine :

cat f1...
6,967
Posted By greet_sed
Hi, Can you try like this? DATE=$(date...
Hi,

Can you try like this?

DATE=$(date +%Y%m%d -d "1 day ago")
awk -F, -vy=DATE '$0 ~ y {a[FILENAME]++ } END { for (i in a) { print i a[i] }}' /path1/usr/STAT/GPRS/ESTCOL_GPRS_2016*

If...
2,048
Posted By greet_sed
Hi, You do cd twice so your directory is not...
Hi,

You do cd twice so your directory is not same as when your first line of
for IP in `egrep -o '([0-9]{1,3}\.){3}[0-9]{1,3}' config_ip.cfg`Hence this grep says no such file or directory :
...
1,486
Posted By greet_sed
Hi, No, you can't. Because element is...
Hi,



No, you can't. Because element is removed from array.

See the example:
X=(2H 4S 10D QC)
$ echo ${X[2]}
10D
$ unset X[2]
$ echo ${X }
2H 4S QC

Here X[2] is QC
5,160
Posted By greet_sed
Hi, IMO, command you have tried looks good...
Hi,

IMO, command you have tried looks good :b:
1,681
Posted By greet_sed
Hi, try like below: #!/usr/bin/perl -w ...
Hi,

try like below:
#!/usr/bin/perl -w

my @a = ("hi", "hello", "GigabitEthernet1/0/3 is down, line protocol is down (notconnect)");

foreach (@a) {
if ( $_ =~ /(.*) is down,.*/) {
...
1,466
Posted By greet_sed
Hi, I don't think it is problem with quotes...
Hi,

I don't think it is problem with quotes in sed instead of variable declaration.

Here is the example:
A="Hi"; echo $A
Hi
A=\"Hi\"; echo $A
"Hi"
A="\"12-11-16|11 2016 Jan...
965
Posted By greet_sed
Hi, Change the line as follows: my...
Hi,

Change the line as follows:
my $rx_var2 = (qr/^311480[*0-9a-fA-F]{11}$|^[0-9A-Fa-f]{10}
{4}$/);

instead of
my $rx_var2 = (qr/^311480[*0-9a-fA-F]{11}$/|qr/^[0-9A-Fa-f]{10}
{4}$/);
2,076
Posted By greet_sed
Hi, Hope this helps.
Hi,

Hope this helps.
23,273
Posted By greet_sed
Hi, Not sure your intention. I doubt it...
Hi,

Not sure your intention.

I doubt it is possible to get fileds without $ in awk.

If you are sure with your input content, below experimental one works:
echo "12 44 45 552 24" | sed -e...
964
Posted By greet_sed
Hi, What are your attempts? Below one...
Hi,

What are your attempts?

Below one could be start point :

sed -e 's/Ç/C/;s/Õ/O/g' file

It gives desired output.

i added g for global replacement if same character has to be...
1,752
Posted By greet_sed
Hi, Here is without other text utilities: ...
Hi,

Here is without other text utilities:

#!/bin/bash

while read a b c
do
IFS=$','
for i in $b
do
echo $a $i $c
done
IFS=$' '
done < file
1,077
Posted By greet_sed
Hi, your input contains small p in password...
Hi,

your input contains small p in password so try the below one:

sed "s/name=\"\" password=\"\"/name=\"somename\" password=\"somepassword\"/" inputfile > outputfile
1,453
Posted By greet_sed
Hi, Can you try the below one? find ....
Hi,

Can you try the below one?

find . -name "v*" | while read i
do
tmp=$(echo "$i" | sed -e 's/\&\&\&/-/' -e 's/ __ //' -e 's/\.[a-z]*$//' -e...
1,453
Posted By greet_sed
Hi, see if this helps. #!/bin/bash ...
Hi,

see if this helps.


#!/bin/bash

for i in v*;
do
tmp=$(echo "$i" | sed -e 's/\&\&\&/-/' -e 's/__//')
tmp2=${tmp%.*}
tmp3=$(echo $tmp2 | sed -e...
2,538
Posted By greet_sed
bit shorter: sed -e 's/, /&\n/g' file
bit shorter:
sed -e 's/, /&\n/g' file
1,491
Posted By greet_sed
Hi, cat xx xft ui ui uk awk...
Hi,

cat xx
xft ui ui uk
awk -F'\t' '{$1=x;sub(/^\t/,y)}1' OFS='\t' xxGives desired output:
ui ui ukawk '{$1=x;sub(/^\t/,y)}1' OFS='\t' file
I doubt your file is tab limited.
1,582
Posted By greet_sed
Can you try like the following ? awk -F\'...
Can you try like the following ?

awk -F\' '{for(i=1;i<=NF;i++) if ($i ~ "3-") a++ } END { print a+0 } file
2,419
Posted By greet_sed
Hi, Following one works in bash from...
Hi,

Following one works in bash from terminal through bash history ( Not from the script ) :
cp file_w30.tex !#:1:s/_w30/_w31/!# - Refers to current command line typed so far.
1 - Refers to...
2,419
Posted By greet_sed
Hi, You did not try what i have posted in...
Hi,

You did not try what i have posted in post#4. Here is the tested code.

touch foo1 foo2 foo3
ls
foo1_bar foo2_bar foo3_bar
foreach i ( foo* )
foreach? mv $i "$i"_bar
foreach? end
...
3,731
Posted By greet_sed
Hi, can you try the following and see if it...
Hi,

can you try the following and see if it helps ?

sed -re 's/(.*)\.[0-9]{1,2}/\1.x/' file

other way:
sed -re 's/\.[0-9]{1,2}'"'"'/.X/' file

you might need to adapt depends on your...
Showing results 1 to 25 of 81

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