Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Aug 2007 16:54:08 +0200
From:      "Heiko Wundram (Beenic)" <wundram@beenic.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: semi OT: sh scripting problem
Message-ID:  <200708011654.08611.wundram@beenic.net>
In-Reply-To: <18096.39488.530454.883753@jerusalem.litteratus.org>
References:  <18096.39488.530454.883753@jerusalem.litteratus.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Am Mittwoch 01 August 2007 16:35:44 schrieb Robert Huff:
> 	Is there a way within the script - or, failing that, by
> modifying FILE - to not break at the whitespace?

If you're using bash, set IFS to the newline only before looping. I guess the 
tcsh also has a similar setting, but I wouldn't know where to look.

---
IFS="
"

for i in `cat file`
do
	...
done
---

HTH!

-- 
Heiko Wundram
Product & Application Development



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708011654.08611.wundram>