From owner-freebsd-questions@FreeBSD.ORG Tue Dec 1 20:04:48 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 456D4106566B for ; Tue, 1 Dec 2009 20:04:48 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id 05DEB8FC1A for ; Tue, 1 Dec 2009 20:04:47 +0000 (UTC) Received: from r55.edvax.de (port-92-195-228-22.dynamic.qsc.de [92.195.228.22]) by mx01.qsc.de (Postfix) with ESMTP id 066E23D58B; Tue, 1 Dec 2009 21:04:45 +0100 (CET) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id nB1K4itV002868; Tue, 1 Dec 2009 21:04:45 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Tue, 1 Dec 2009 21:04:43 +0100 From: Polytropon To: =?ISO-8859-1?Q?D=E1nielisz_L=E1szl=F3?= Message-Id: <20091201210443.0e812d0f.freebsd@edvax.de> In-Reply-To: <560275.79074.qm@web30808.mail.mud.yahoo.com> References: <560275.79074.qm@web30808.mail.mud.yahoo.com> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions@freebsd.org Subject: Re: bash script question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 20:04:48 -0000 On Tue, 1 Dec 2009 11:48:43 -0800 (PST), D=E1nielisz L=E1szl=F3 wrote: > I just find out: >=20 > #!/usr/local/bin/bash > export IFS=3D" " > cuc=3D$* > mkdir "cuc" The $* variable will expand to all arguments given on the command line, e. g. $ ./myscript foo bar baz will result in mkdir "foo bar baz" and so create a directory named foo\ bar\ baz including the spaces. If you only want to access the first parameter, use $1, and for good form, check it before further processing. Your use of quotes to include the parameter is already good form. :-) --=20 Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...