From owner-freebsd-questions@FreeBSD.ORG Mon Jan 12 15:04:38 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2D9E316A4CE for ; Mon, 12 Jan 2004 15:04:38 -0800 (PST) Received: from mail.cult.cu (ns2.cubarte.org [169.158.120.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8B5FE43D39 for ; Mon, 12 Jan 2004 15:04:32 -0800 (PST) (envelope-from admin@atenas.cult.cu) Received: from [169.158.120.178] (helo=mail.atenas.cult.cu) by mail.cult.cu with esmtp (Exim 4.22) id 1AgBBu-000JLb-27 for freebsd-questions@freebsd.org; Mon, 12 Jan 2004 18:09:50 -0500 Received: from [192.168.1.9] (helo=bloodlust) by mail.atenas.cult.cu with smtp (Exim 3.34 #1) id 1AgB0F-0000EU-00 for freebsd-questions@FreeBSD.ORG; Mon, 12 Jan 2004 17:57:47 -0500 Message-ID: <001601c3d960$696a5550$0901a8c0@bloodlust> From: "Xpression" To: "FreeBSD-questions" Date: Mon, 12 Jan 2004 18:04:20 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Subject: Script question... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2004 23:04:38 -0000 Hi list, I've making a script to write the content of three text files to one file, but I want to separate each files by a delimiter like the name of the file. This is the script: #! /bin/sh path=/some/dir if !([ -f $path/this.one ]); then for file in $path/file1 $path/file2 $path/file3; do cat $file >> $path/this.one done fi exit 0 By now the output is: Contents of file1 Contents of file2 Contents of file3 And I want to be like this: ----------------------------------------------------------------------- file1 ----------------------------------------------------------------------- Contents of file1 ----------------------------------------------------------------------- file2 ----------------------------------------------------------------------- Contents of file2 ----------------------------------------------------------------------- file3 ----------------------------------------------------------------------- Contents of file3 any suggestion ??? Thanks...