|
Re: lug-bg: X-problem - bash script
- Subject: Re: lug-bg: X-problem - bash script
- From: ntk@xxxxxxxxxx (Nikolay Kabaivanov)
- Date: Sun, 08 Oct 2000 13:41:39 +0200
EDAC wrote:
> EDAC
> P.S. Oshte edin typ vypros. Pisha si bash script. Imam promenliva,
> koiato se systoi ot dve dumi razdeleni s interval. Kak da rygna dvete
> dumi pootdelno v dve drugi promenlivi. Naprimer, imam VAR="abc def"
> i iskam da polucha VAR1="abc" i VAR2="def". Kak da go napravia?
Zdrawej
ne sum specialist, no az bih izpolzwal comandata "cut" ako znaesh tochno
kude iskash da otrezesh dumite i wsicko e s fiksirana dulzina. No naj
dobre bi bilo s awk, moze bi eto taka :
$purwa= `echo $dwe_promenliwi | awk '{printf($1)}'`
$wtora= `echo $dwe_promenliwi | awk '{printf($2)}'`
Sigurno moze da se naprawi optimizacia i wsicko da stane na 1 red i bez
printf.
BYE
----------------------------------
Nikolay Kabaivanov, ntk@xxxxxxxxxx
University of Rousse, Bulgaria
==================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers)
Otpiswaneto RABOTI !!! : Majordomo@xxxxxxxxxxxxxxxxxx UNSUBSCRIBE LUG-BG
http://www.linux-bulgaria.org/ Hosted by Internet Group Ltd. - Stara Zagora
|
|
|