Re: UC Need help in writing a shell/bash script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Rushton Martin wrote:
> I knocked up the enclosed under Cygwin:
>
> #!/bin/sh
> (
> 	cat <<EOTx
>                 admin                      ankush
>                 admin                       amit
>                 powerusers               dinesh
>                 powerusers               jitendra
> EOTx
> ) | awk '
> 	{
> 		grpnm[$1] = grpnm[$1] ", " $2
> 	}
> 	END {
> 		for (i in grpnm) {
> 			print i ":	" substr(grpnm[i], 3)
> 		}
> 	}
> ' | sort
>
<snip>
Why use cat? Why not just stick the filename in the command line, right
after the closing ', and before the pipe?

        mark


_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux