GNU bug report logs - #23227
Inconsistent behavior for --file=~/some-file

Previous Next

Package: grep;

Reported by: Santiago Ruano Rincón <santiagorr <at> riseup.net>

Date: Tue, 5 Apr 2016 21:56:01 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Santiago Ruano Rincón <santiagorr <at> riseup.net>
To: 23227 <at> debbugs.gnu.org
Subject: bug#23227: Inconsistent behavior for --file=~/some-file
Date: Tue, 5 Apr 2016 23:55:41 +0200
Hi,

grep fails to parse the tilde (~) to represent $HOME, when it is used to
give a file's path to --file=, but it works with --file

% echo "a" > ~/tmp-pattern
% echo "hola" | LANG=C grep --file=/home/santiago/tmp-pattern
hola
% echo "hola" | LANG=C grep --file /home/santiago/tmp-pattern
hola
% echo "hola" | LANG=C grep --file ~/tmp-pattern
hola
% echo "hola" | LANG=C grep --file=${HOME}/tmp-pattern 
hola
% echo "hola" | LANG=C grep --file=~/tmp-pattern
grep: ~/tmp-pattern: No such file or directory

This was filed in debian:
https://bugs.debian.org/504804

Cheers,

Santiago




This bug report was last modified 9 years and 105 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.