From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on sa.int.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Date: Mon, 1 Sep 2008 23:10:13 +0300 From: Michael Shigorin To: ALT Linux Community general discussions Message-ID: <20080901201013.GS21919@osdn.org.ua> Mail-Followup-To: ALT Linux Community general discussions References: <48BAA80D.9030602@rambler.ru> <200808312221.19761.jay4mail@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <200808312221.19761.jay4mail@gmail.com> User-Agent: Mutt/1.4.2.1i Subject: Re: [Comm] =?koi8-r?b?68HLINXEwczJ1Ngg0NLPwsXM2Q==?= X-BeenThere: community@lists.altlinux.org X-Mailman-Version: 2.1.10b3 Precedence: list Reply-To: shigorin@gmail.com, ALT Linux Community general discussions List-Id: ALT Linux Community general discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2008 20:10:17 -0000 Archived-At: List-Archive: List-Post: On Sun, Aug 31, 2008 at 10:21:19PM +0400, Yuri Bushmelev wrote: > > Как удалить пробелы в начале строки? > > Нужно для скрипта в bashe Бишь #!/bin/bash в начале. > > Допустим > > t=" 123 123 " > > а в результате получилось бы > > "123 123 " > > a=" 123 "; b=${a##+( )}; echo "'$b'" > '123 ' > > Будет работать в bash. Для других шеллов не обещаю.. Причём если включить extglob: shopt -s extglob См. pathname expansion в bash(1). -- ---- WBR, Michael Shigorin ------ Linux.Kiev http://www.linux.kiev.ua/