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


Groups > linux.debian.user > #183243

Re: Bash Question

From Javier Barroso <javibarroso@gmail.com>
Newsgroups linux.debian.user
Subject Re: Bash Question
Date 2017-07-06 00:30 +0200
Message-ID <u00Y1-3WC-1@gated-at.bofh.it> (permalink)
References <u00lk-3rk-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

On Wed, Jul 5, 2017 at 11:12 PM, Rainer Dorsch <ml@bokomoko.de> 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?

You need to scape "<" and ">":

if [ "abc" \> "dec" ] ; then ... ;fi
if [ "abc" '>' "dec" ]; then ... ; fi
if [ "abc" ">" "dec" ]; then ... ; fi


Delete "dec" file, ( ">" is redirection in bash, so you was creating that file

Regards

Back to linux.debian.user | Previous | Next — Previous in thread | Next 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