Bug 1273474 - glob doesn't work in tcsh
glob doesn't work in tcsh
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: tcsh (Show other bugs)
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: David Kaspar [Dee'Kej]
BaseOS QE - Apps
: Patch
Depends On: 1076343
  Show dependency treegraph
Reported: 2015-10-20 09:54 EDT by David Kaspar [Dee'Kej]
Modified: 2015-12-07 11:36 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1076343
Last Closed: 2015-12-07 11:36:03 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description David Kaspar [Dee'Kej] 2015-10-20 09:54:55 EDT
+++ This bug was initially created as a clone of Bug #1076343 +++

Description of problem:

  glob doesn't work in tcsh.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:

1. Make three files.
  % touch {a,b,c}.txt

2. Use glob
  % echo `glob *.txt`

Actual results:


Expected results:

  a.txt b.txt c.txt

Additional info:

  It works on RHEL4.

--- Additional comment from penguin admin on 2014-03-15 00:00:31 EDT ---

I noticed this works in tcsh
echo `glob \*txt`
a.txt b.txt c.txt

$ rpm -q tcsh

$ set globit='glob *.txt'
$ $globit

--- Additional comment from Jaromír Končický on 2014-03-17 06:32:22 EDT ---

This worked for me too:

$ set textdocs=*.txt
$ echo $textdocs
a.txt b.txt c.txt

Do you want/need to use `glob *.txt` for any purpose (in some script)?

--- Additional comment from Pavel Raiskup on 2014-03-17 11:50:00 EDT ---

(In reply to Yoshifumi Kinoshita from comment #0)
> Description of problem:
>   glob doesn't work in tcsh.

The glob does work, you just get the output as one string of many file-names
matching divided by the 'zero-byte'.  This is not the same as the echo works
(echo puts space between matching file-names).

From `man tcsh`:

  glob wordlist
    Like  echo,  but the `-n' parameter is not recognized and words
    are delimited by null characters in  the  output.   Useful  for
    programs  which wish to use the shell to filename expand a list
    of words.

So the problem here is probably that backticks are not able to parse the
'null' terminating character.  Could our customer use rather 'echo' instead?

Not sure whether this is a bug or not, this is currently also upstream issue
and worth asking there.


--- Additional comment from Fridolín Pokorný on 2015-02-04 07:35:43 EST ---

Upstream accepted proposed patch:

Comment 2 David Kaspar [Dee'Kej] 2015-12-07 11:36:03 EST
Please, see the justification for closing in the initial bug.

Note You need to log in before you can comment on or make changes to this bug.