[wellylug] Default value in read

Jim Cheetham jim at gonzul.net
Wed May 9 10:06:07 NZST 2007


In which language are you writing now?

I don't see that bash has any way of pushing data into the input
buffer ... hacking with /dev/stdin isn't helping much. Perhaps try
something with expect?

On 09/05/07, Sigurd Magnusson <sigurd at silverstripe.com> wrote:
>
>
>
>
>
>
> Its fine to do this...
>
>  read -p "Please provide domain name, without www prefix, e.g.
>  google.com: " domainname ;
>
>  But how do I do this?
>
>  $defaultvalue=google.com
>  read -p "Please provide domain name, without www prefix, e.g.
>  google.com: " $defaultvalue domainname ;
>
>
>  (In which I want the user to be able to be able to EDIT the default
>  value, as most times the default is correct, or needing a minor change,
>  e.g. ".com" might change to "co.nz" )
>
>  Siggy
>
> Sigurd Magnusson | Operations Director
>
>
>     SilverStripe
>     http://www.silverstripe.com
>
> Phone:+64 4 978 7332
> Mobile:+64 21 421 208
> Skype:
>                                      Level 3
>        97-99 Courtenay Place
>        Wellington, New Zealand
>
>
> --
> Wellington Linux Users Group Mailing List: wellylug at lists.wellylug.org.nz
> To Leave:  http://lists.wellylug.org.nz/mailman/listinfo/wellylug
>
>
>




More information about the wellylug mailing list