[CentOS] UC Need help in writing a shell/bash script
m.roth at 5-cent.us
m.roth at 5-cent.usFri Dec 30 15:05:41 UTC 2011
- Previous message: [CentOS] UC Need help in writing a shell/bash script
- Next message: [CentOS] UC UC Need help in writing a shell/bash script
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: [CentOS] UC Need help in writing a shell/bash script
- Next message: [CentOS] UC UC Need help in writing a shell/bash script
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list