Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

ls glob fails from program

2010-10-19
2013-04-22
  • the command: "ls dummy.*.s", works fine if typed from the mged command line. But, any ls command, with an asterisk,
    fails when run from in a tcl program. I tried a number of variations, and none worked. See the test program, below.
    I have a workaround to explicitly list all of the possible file names that are expected, but this largely
    defeats the purpose of glob.

    Is this a bug or am I missing something?

    Gilligan


    #!/usr/brlcad/bin/tclsh

    proc globTst {} {
        variable glob_compat_mode
        puts $glob_compat_mode
        ls dummy.*.s ; # BAD
        #ls "dummy.*.s" ; # BAD
        #set lsCmd "ls dummy.*.s"
        #eval $lsCmd ; # BAD
    }

    globTst

    for the program to work, create some files to match: "dummy.*.s", or change "dummy.*.s" to match files you have.