Termux-packages: grep, sed and spanish accents

Created on 19 Apr 2020  路  6Comments  路  Source: termux/termux-packages

Problem description

grep and sed don't work with spanish accent. For example, "echo cami贸n|grep cami贸n", the terminal cannot find anything.

_20200419_011642

Steps to reproduce

grep (v.3.4)
echo "cami贸n"|grep "cami贸n"
the terminal cannot find anything.

In sed (4.8) doesn't work either.
echo cami贸n|sed s/'贸'/'\'"'o"/g

Could it be a problem of variable LANG?

Expected behavior

echo "cami贸n"|grep "cami贸n"
Reply: cami贸n

echo cami贸n|sed s/'贸'/'\'"'o"/g
Reply: camion

Additional information

Updatable packages:
git/stable 2.26.1 aarch64 [upgradable from: 2.26.0]
Android version:
9
Kernel build information:
Linux localhost 4.4.148-perf+ #1 SMP PREEMPT Wed May 22 10:44:11 2019 aarch64 Android
Device manufacturer:
Sony
Device model:
G8141


bug report

All 6 comments

It works in Android's native version of grep

It works in Android's native version of grep

They still haven't solved that nonsense, disappointing.

Btw, is there a good reason the native Android apps are not in $PATH by default?
If they were it would be a lot easier to just delete Termux's grep and then the Android one would be used. Either way, just having it on the end by default seems smart to me, there might be apps available there that's not in Termux too

Btw, is there a good reason the native Android apps are not in $PATH by default?

  1. If user don't have corresponding package installed for some reason, utility will be picked from /system but user will not know what exactly is being used.
  2. System utilities may have different behavior. In this case, results of (1) will get even worse.
  3. System utilities may have different command line args. In this case, results of (1) will get even worse.
  4. Access to system utilities can be restricted by SELinux. I, for example, can't list /system/bin at all.
  5. Termux purpose is to bring a normal port of GNU/Linux tools, not use ones from system. Issues, of course, are expected.
  6. Termux scripts rely on tools from $PREFIX, their usage syntax and behavior.

Want to have /system/bin in $PATH, configure it in ~/.bashrc or what is being loaded by your shell.

If they were it would be a lot easier to just delete Termux's grep

It is essential package and included as dependency in other essential/non-essential packages. Deleting it will simply cause serious dependency tree breakage which will lead to issues with package manager.

At least my Samsung Galaxy has accessible binaries in /vendor/bin, but that might not be the same for every phone. But besides that, you make some very good points, xeffyr. Let's hope the bug gets fixed in a future release then.

Termux scripts rely on tools from $PREFIX

In the case: dev-28.apk (and other target>=29 versions) these are symlinks to $nl = _native library._ However, there is libcre.so (grep only) missing, so /system/bin is required andgrep needs to be (re)moved. Otherwise I join the hope of @S-E-TT

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thurask picture thurask  路  3Comments

tigran123 picture tigran123  路  3Comments

roycebank picture roycebank  路  3Comments

ILadis picture ILadis  路  3Comments

am11 picture am11  路  3Comments