Is Bash expanding the "*" character in my python command line parameter? -


with following command in bash:

python myscript.py filename_pattern* 

i got 2 different sys.argv in 2 linux machines:

  • machine a: sys.argv[1] = filename_pattern*
  • machine b: sys.argv[1] = filename_pattern-2013-06-30

note: filename_pattern-2013-06-30 file in current directory.

one of colleague tell me that's evil of bash. check bash in 2 machines of same version, , checked ~/.bashrc, /etc/bashrc, /etc/profile.d/*.sh too.

can point out how come 2 same version bash act differently ?

it because in 1 of machine, in folder, there in no file match pattern. when happens, * remains. can test 1 computer, , without file match pattern. there reason, shell option nullglob disabled. can read gnu bash reference this.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -