Oct 3, 2012 #1 w5000 Technical User Nov 24, 2010 223 PL is it possible to get working it with variable instead of plane/written "n/a" ? so, v="n/a" and then: echo ${var:-[red]$v[/red]} (but of course working one ;-) )
is it possible to get working it with variable instead of plane/written "n/a" ? so, v="n/a" and then: echo ${var:-[red]$v[/red]} (but of course working one ;-) )
Oct 3, 2012 #2 feherke Programmer Aug 5, 2002 9,540 RO Hi Do you have a version restriction too ? That works for me in MKsh : Code: [blue]master[/blue] # v="n/a" [blue]master[/blue] # echo ${var:-$v} n/a [blue]master[/blue] # var=wtf [blue]master[/blue] # echo ${var:-$v} wtf Feherke. [link feherke.github.com/]http://feherke.github.com/[/url] Upvote 0 Downvote
Hi Do you have a version restriction too ? That works for me in MKsh : Code: [blue]master[/blue] # v="n/a" [blue]master[/blue] # echo ${var:-$v} n/a [blue]master[/blue] # var=wtf [blue]master[/blue] # echo ${var:-$v} wtf Feherke. [link feherke.github.com/]http://feherke.github.com/[/url]
Oct 3, 2012 Thread starter #3 w5000 Technical User Nov 24, 2010 223 PL hmmm.... it looks it works in the simplest way... Code: $ ddd=bbb $ echo ${SVSA:-$ddd} bbb $ ddd=n/a $ echo ${SVSA:-$ddd} n/a $ echo ${SVSA:-$ddd} n/a stange... ;-) Upvote 0 Downvote
hmmm.... it looks it works in the simplest way... Code: $ ddd=bbb $ echo ${SVSA:-$ddd} bbb $ ddd=n/a $ echo ${SVSA:-$ddd} n/a $ echo ${SVSA:-$ddd} n/a stange... ;-)
Oct 3, 2012 Thread starter #4 w5000 Technical User Nov 24, 2010 223 PL nice, even coloured.... Code: $ r="\033[31m" $ n="\033[00m" $ echo ${SVSA:-$r$ddd$n} [red]n/a[/red] $ Upvote 0 Downvote
nice, even coloured.... Code: $ r="\033[31m" $ n="\033[00m" $ echo ${SVSA:-$r$ddd$n} [red]n/a[/red] $