Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #183245

Re: Bash Question

From Phil Wyett <philwyett@kathenas.org>
Newsgroups linux.debian.user
Subject Re: Bash Question
Date 2017-07-06 00:40 +0200
Message-ID <u017H-3ZA-9@gated-at.bofh.it> (permalink)
References <u00lk-3rk-19@gated-at.bofh.it>
Organization Kathenas

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Wed, 2017-07-05 at 23:12 +0200, Rainer Dorsch wrote:
> Hi,
>  
> can anybody help to explain what is going on here ?
>  
>  
> rd@mohot:~$ echo $SHELL 
> /bin/bash 
> rd@mohot:~$ if [ "abc" > "dec" ]; then echo bad; fi       
> bad 
> rd@mohot:~$ if [ "abc" < "dec" ]; then echo good; fi 
> good 
> rd@mohot:~$ 
> 
> How can abc sort before and after dec at the same time?
>  
> Thanks
> Rainer
>  
>  
> -- 
> Rainer Dorsch
> http://bokomoko.de/


Hi,

Not sure what you are exactly trying to accomplish and you may need
to explain further.

If you want to basic string compare:

if [[ "abc" < "dec" ]]; then echo true; else echo false; fi

Regards

Phil

-- 
*** If this is a mailing list, I am subscribed, no need to CC me.***

Playing the game for the games sake.

Web: https://kathenas.org

Twitter: kathenasorg

Instagram: kathenasorg

Back to linux.debian.user | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Bash Question Rainer Dorsch <ml@bokomoko.de> - 2017-07-05 23:50 +0200
  Re: Bash Question Sven Joachim <svenjoac@gmx.de> - 2017-07-06 00:10 +0200
  Re: Bash Question Jonathan Marquardt <parckwart@parckwart.de> - 2017-07-06 00:10 +0200
    Re: Bash Question "der.hans" <deb-user@LuftHans.com> - 2017-07-06 00:40 +0200
      Re: Bash Question Jonathan Marquardt <parckwart@parckwart.de> - 2017-07-06 00:50 +0200
  Re: Bash Question "der.hans" <deb-user@LuftHans.com> - 2017-07-06 00:10 +0200
    Re: Bash Question David <bouncingcats@gmail.com> - 2017-07-06 09:30 +0200
      Re: Bash Question Greg Wooledge <wooledg@eeg.ccf.org> - 2017-07-06 14:00 +0200
  Re: Bash Question Javier Barroso <javibarroso@gmail.com> - 2017-07-06 00:30 +0200
    Re: Bash Question Darac Marjal <mailinglist@darac.org.uk> - 2017-07-06 11:00 +0200
      Re: Bash Question <tomas@tuxteam.de> - 2017-07-06 12:00 +0200
        Re: Bash Question Rainer Dorsch <ml@bokomoko.de> - 2017-07-06 13:50 +0200
  Re: Bash Question Phil Wyett <philwyett@kathenas.org> - 2017-07-06 00:40 +0200

csiph-web