Search Results

Search: Posts Made By: Kanchana
2,165
Posted By Scrutinizer
Try: bash + GNU date (slow): for i in {1..5};...
Try: bash + GNU date (slow):
for i in {1..5}; do
date -d "$i minutes ago" +%d-%m-%Y_%H-%M
done

Or ksh (fast):
for i in {1..5}; do
printf "%(%d-%m-%Y_%H-%M)T\n" "$i minutes ago"
done
16,543
Posted By ctsgnb
Example : $ cat f1 hostname MAC SWITCH_IP...
Example :

$ cat f1
hostname MAC SWITCH_IP SWITCH_PORT
01HW1234 000 172.20.1.0 Fastethernet0
01HW4567 111 172.20.1.1 Fastethernet1
01HW1234 000 172.20.1.0 Fastethernet2$ cat f2
hostname MAC...
16,543
Posted By Shahul
nawk 'NR==FNR{a[$1]=$1;b[$0]=$0;next}($1 in a)&&...
nawk 'NR==FNR{a[$1]=$1;b[$0]=$0;next}($1 in a)&& !($0 in b)' file1 file2


Thanks
SHa
16,543
Posted By ctsgnb
awk 'NR==1{print}NR==FNR{a[$1]=$0;next}($1 in...
awk 'NR==1{print}NR==FNR{a[$1]=$0;next}($1 in a)&&$0!=a[$1]' file1 file2


The code :
nawk 'NR==FNR{a[$1]=$0;next}($1 in a) {print}' file1 file2
May not behave the way you expect since it print...
Showing results 1 to 4 of 4

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