![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Linux FAQ Items | prashant_ohol | Gentoo | 11 | 09-12-2006 11:21 AM |
| Comma Seperated List of Values | brap45 | Shell Programming and Scripting | 9 | 02-23-2006 05:12 AM |
| Handling .CSV( Comma seperated value) in awk | Laud12345 | Shell Programming and Scripting | 1 | 05-09-2005 05:41 PM |
| How to load comma seperated values file (*.csv) into Oracle table | handynas | UNIX for Advanced & Expert Users | 4 | 06-24-2002 01:35 PM |
| How to load comma seperated values file (*.csv) into Oracle table | handynas | UNIX for Dummies Questions & Answers | 5 | 06-05-2002 12:10 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
change list to comma seperated items
I have a list of servers in a file called serverlist like this
server1 server2 server3 i need to have them (with no trailing comma, the program does not like that) server1,server2,server3 so far i have been using HOSTS=/tmp/serverlist HOSTS=${HOSTS:-$(grep -Ev "^#|^$" $HOSTS_LOCAL)} HOSTS=$(echo $HOSTS |tr -s '\n ' ',,') HOSTS=${HOSTS%,} to achieve this. It works but is there a quicker easier way say like in one line. (I need the grep -Ev "^#|^$" because we have a lot and need to comment them out sometimes). Sean |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|