Search Results

Search: Posts Made By: Dr_Aleman
4,567
Posted By pravin27
Use -v option with awk. nawk -v var=$ABC...
Use -v option with awk.

nawk -v var=$ABC 'BEGIN{FS=";";OFS=";"} {if (var) {$5=10}; print $0}' dir/file1.txt > dir/file2.txt
4,567
Posted By michaelrozar17
Can you try by assigning $ABC to an awk...
Can you try by assigning $ABC to an awk variable..
nawk -v var="$ABC" '{FS=";";OFS=";"; if (var) {$5=10}; print $0}' dir/file1.txt > dir/file2.txt
or directly w/o awk variable
nawk...
Showing results 1 to 2 of 2

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