From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,bcce8fba79ad8489 X-Google-Attributes: gidfa528,public From: Robert Mulley Subject: Re: korn shell Date: 2000/11/14 Message-ID: <3A1162EC.6DBA7560@gnsconsulting.com.au>#1/1 X-Deja-AN: 693521952 Content-Transfer-Encoding: 7bit References: <8urkfl$2i3$1@nnrp1.deja.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@mailint03.im.hou.compaq.com X-Trace: mailint03.im.hou.compaq.com 974217958 27028 16.37.50.195 (14 Nov 2000 16:05:58 GMT) Organization: Compaq Computer Corp. Mime-Version: 1.0 Reply-To: robert@gnsconsulting.com.au NNTP-Posting-Date: 14 Nov 2000 16:05:58 GMT Newsgroups: comp.unix.tru64 Hello I believe it means either use the value of $2 or -10. ie if this is in a script called "george" and you were to run: ./george sort_this_file 27 Then it would sort "sort_this_file" and display to first 27 lines otherwise if you ran: ./george sort_this_file it would sort "sort_this_file" and display the first 10 lines. ${2:-10} means either use the value of $2 or if $2 is NULL use the "default" value -10. Hope I've explained this to your satisfaction. Robert Mulley Unix Admin tru64man@my-deja.com wrote: > I'm learning Korn here but I promise I will not flood this newsgroup > with trivial questions but I'm either lost or I'm an idiot. I'm reading > the book "Learning the Korn Shell" by Rosenblatt. On page 98 it > indicates a piece of code that I don't understand. > > sort -nr $1 | head -${2:-10} > > I know what sort and its options mean, the pipe sign, and the head > utility--no problem there. But I don't understand the last part > -${2:-10} > > Could someone explain that part to me in somewhat elementary details? > thanks in advance. > > Untru64Man > > Sent via Deja.com http://www.deja.com/ > Before you buy.