Search Results

Search: Posts Made By: khestoi
4,252
Posted By DGPickett
I'd rather edit with sed: sed ' ...
I'd rather edit with sed:
sed '
s/\.cfg$/'"$1"'/
t
s/$/'"$1"'/
' /usr/text

However, you can ksh-substring your variables like line: ${line#*.} is everything after the first dot,...
4,252
Posted By Scott
X=${1:-1.0.0} while IFS=. read NAME EXT; do ...
X=${1:-1.0.0}
while IFS=. read NAME EXT; do
echo $NAME$X.$EXT
done < file
26,733
Posted By Scott
:D I don't always create as much test data...
:D

I don't always create as much test data as I should!


$ awk '$0 ~ S || C { C++ } C-1 > A { C = 0 } C' S="some_regex" A=2 file1
Showing results 1 to 3 of 3

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