Public bug reported:

cd /tmp
rm -Rf tst err
echo 'if [ "$1" == "" ]; then echo "empty"; else cat $1; fi' > tst
chmod +x tst
echo "a" > err
ls err | xargs ./tst # ./tst: 1: [: err: unexpected operator
./tst err # works fine, outputs 'a'

On Ubuntu the error will be shown, on Centos it won't. The error looks
to be incorrect.

$ lsb_release -rd
Description: Ubuntu 18.04.1 LTS
Release: 18.04
$ xargs --version
xargs (GNU findutils) 4.7.0-git
Copyright (C) 2017 Free Software Foundation, Inc.

** Affects: ubuntu
     Importance: Undecided
         Status: New

** Description changed:

- cd /tmp
- rm -Rf tst err
- echo 'if [ "$1" == "" ]; then echo "empty"; else cat $1; fi' > tst
- chmod +x tst
- echo "a" > err
- ls err | xargs ./tst     # ./tst: 1: [: err: unexpected operator
- ./tst err                # works fine, outputs 'a'
- 
- On Ubuntu the error will be shown, on Centos it won't. The error looks
- to be incorrect.
- 
- $ lsb_release -rd
- Description:  Ubuntu 18.04.1 LTS
- Release:      18.04
- $ xargs --version
- xargs (GNU findutils) 4.7.0-git
- Copyright (C) 2017 Free Software Foundation, Inc.
+ <duplicated by 1793668> please close

** Description changed:

- <duplicated by 1793668> please close
+ cd /tmp
+ rm -Rf tst err
+ echo 'if [ "$1" == "" ]; then echo "empty"; else cat $1; fi' > tst
+ chmod +x tst
+ echo "a" > err
+ ls err | xargs ./tst # ./tst: 1: [: err: unexpected operator
+ ./tst err # works fine, outputs 'a'
+ 
+ On Ubuntu the error will be shown, on Centos it won't. The error looks
+ to be incorrect.
+ 
+ $ lsb_release -rd
+ Description: Ubuntu 18.04.1 LTS
+ Release: 18.04
+ $ xargs --version
+ xargs (GNU findutils) 4.7.0-git
+ Copyright (C) 2017 Free Software Foundation, Inc.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1793668

Title:
  xargs gives "[: err: unexpected operator" on Ubuntu but not Centos

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+bug/1793668/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to