On Tuesday, 14 בNovember 2006 22:31, Maxim Vexler wrote:
> Thanks to everyone for the help, all solution worked.
> To sum up the tips:
Hey, what's the rush? I didn't have my take yet ;-)
Let's do it in simple one liner:
sed -e N -e 's/\n/ = /' passwd.fake
Cheers,
--
Oron Peled
This was a very educational thread. Thanks for posing the question and the
summary, and thanks everyone for the useful answers. I don't have a need for
this just yet, but I have saved the thread as I am sure the answers will be
useful sooner or later.
I eagerly await the next educational thread.
On 11/14/06, Oded Arbel <[EMAIL PROTECTED]> wrote:
[snip]
(IFS="$(echo)"; \
for pair in `awk '/^[^[].+[^\n]$/ {print $1,$3}' passwd.fake`; do
echo "$pair"; done)
In the second example, I force the record separator to be only the new
line character (the output from 'echo'. I can probably use \n,
On Tuesday 14 November 2006 12:34, Ehud Karni wrote:
I don't understand why all this voodoo is needed. If you have a list
of spaced delimited values and want to use a for or while loop to
read them, just fix $IFS locally (the default of IFS is tab or space or
newline). You can make $IFS only be ne
What about something like following:
while read line; do
case "x$line" in
x)
# empty line, do nothing
;;
x[ | x])
# you don't like brackets, do nothing too
;;
*)
# Everything else
set -- $line
# Now $1
On 11/14/06, Maxim Vexler <[EMAIL PROTECTED]> wrote:
[snip]
san-svn:/var/lib/svn# for pair in `awk '/^[^[].+[^\n]$/ {print $1,
$3}' passwd.fake`; do xargs "$pair" | echo; done
san-svn:/var/lib/svn# for pair in `awk '/^[^[].+[^\n]$/ {print $1,
$3}' passwd.fake`; do xargs "$pair" | echo -; done
-
On Tue, 14 Nov 2006 11:56:18 Maxim Vexler wrote:
>
> I'm having the most annoying issue with bash, one related to space
> delimited variables.
[snip]
>
> Here's an example:
>
> san-svn:/var/lib/svn# cat passwd.fake
> [users]
> user1 = password1
> user2 = password2
>
[snip]
>
> I'd like to automat
Hi list, any bash gurus in the house ?
I'm having the most annoying issue with bash, one related to space
delimited variables.
I'd like to get a list in the form of :
<<<
user1 password1
user2 password2
Instead I'm getting:
<<<
user1
password1
user2
password2
Here's an example:
san-svn:/
On 14/11/06, Maxim Vexler <[EMAIL PROTECTED]> wrote:
Hi list, any bash gurus in the house ?I'm having the most annoying issue with bash, one related to spacedelimited variables.I'd like to get a list in the form of :<<>>Instead I'm getting:<<
On Tue, 2006-11-14 at 12:05 +0200, Maxim Vexler wrote:
> On 11/14/06, Maxim Vexler <[EMAIL PROTECTED]> wrote:
> san-svn:/var/lib/svn# for pair in `awk '/^[^[].+[^\n]$/ {print $1,$3}'
> passwd.fake`; do echo "$pair" | xargs echo ; done
> user1
> password1
> user2
> password2
I think you are approac
10 matches
Mail list logo