Search Results

Search: Posts Made By: avikaljain
6,857
Posted By Chubler_XL
Worked ok here when I removed the exit command...
Worked ok here when I removed the exit command and used different EOF tags for ssh and sudo here-docs:

[chubler@myhost ~]$ ssh remotehost cat /tmp/export.sh
echo "All ok"
exit 3
[chubler@myhost...
29,652
Posted By Yoda
Perform pre-increment and check if greater than 1...
Perform pre-increment and check if greater than 1 to identify duplicates:
awk -F, ' ++A[$1] > 1 { print $1 "is duplicate"; exit 1 } ' file
29,652
Posted By hanson44
$ cat input hiring,no system,yes hiring,yes...
$ cat input
hiring,no
system,yes
hiring,yes
quota,no
quota,maybe

$ sort input | awk 'NR == 1 {p=$1; next} p == $1 { print $1 " is duplicated"} {p=$1}' FS=","
hiring is duplicated
quota is...
1,911
Posted By rdcwayx
awk -F, '!a[$1]++{print $1}' your_file.csv |while...
awk -F, '!a[$1]++{print $1}' your_file.csv |while read server
1,911
Posted By Chubler_XL
Sounds like grep is failing because your datafile...
Sounds like grep is failing because your datafile packlist.dat has a line with too may characters. From memory, grep does not support more that about 2K characters in 1 line.
1,911
Posted By Chubler_XL
Not sure if this is what you were asking for: ...
Not sure if this is what you were asking for:

cut -f1 -d"," your_file.csv | sort -u | while read server
do
grep "^${server}," your_file.csv | your_inbuilt_script.sh
done
Showing results 1 to 6 of 6

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