Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Apr 2002 20:34:06 -0600 (CST)
From:      Ryan Thompson <ryan@sasknow.com>
To:        ann kok <annkok2001@yahoo.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: script 
Message-ID:  <20020415202710.E57269-100000@catalyst.sasknow.net>
In-Reply-To: <20020416020000.95326.qmail@web20110.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
ann kok wrote to freebsd-questions@FreeBSD.ORG:

> Hi all
>
> I have a file, data is as column
>
> File
> ----
> ann
> angel
> brown
> manuel
>
> How do I change the data as line?
> ann angel brown manuel

Not really FreeBSD related, but UNIX related, and so it goes...

Command substitution will do this nicely.

One out of about a dozen ways I could think to accomplish this
(assuming your infile is named file.txt):

	echo `<file.txt`

or

	ls -l `<file.txt`

The key is the ` (backticks: reverse single quotes), which cause the
command inside to be evaluated and returned as arguments to the
preceeding command (in these examples, echo, ls -l).

Enjoy! :-)

- Ryan

-- 
  Ryan Thompson <ryan@sasknow.com>

  SaskNow Technologies - http://www.sasknow.com
  901 1st Avenue North - Saskatoon, SK - S7K 1Y4

        Tel: 306-664-3600   Fax: 306-664-3630   Saskatoon
  Toll-Free: 877-727-5669     (877-SASKNOW)     North America


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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