Search Results

Search: Posts Made By: Lilu_CK
6,018
Posted By balajesuri
#! /bin/bash while read line do if [[...
#! /bin/bash
while read line
do
if [[ $line =~ "AB" ]]
then
line=${line/$(date -d "-1 day" +%Y%m%d)/$(date +%Y%m%d)}
echo $line
else
echo $line
fi...
6,018
Posted By Yoda
Awk Solution:- #!/bin/bash YESTR=$(...
Awk Solution:-

#!/bin/bash

YESTR=$( date -d "-1 day" +%Y%m%d )
TODAY=$( date +%Y%m%d )

awk -v YS=$YESTR -v TD=$TODAY ' {
if(NR==1) {
print; next;
}
if(match($0,/AB/)>0) {
...
11,398
Posted By michaelrozar17
# If the first occurrence of A,B.. to be replaced...
# If the first occurrence of A,B.. to be replaced then..
sed 's/[A-Z]/1/' inputfile

# Replace the A,B.. in the alpha-numeric column
sed 's/\([0-9][0-9]*\)\([A-Z]\)\([0-9][0-9]\)/\11\3/' inputfile
11,398
Posted By bartus11
awk '{sub("[A-Z]","1",$2)}1'...
awk '{sub("[A-Z]","1",$2)}1' file
Showing results 1 to 4 of 4

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