testingfilesizecheck.sh: line 6: /media/doctor/123A123E1A123456/Users/Tim/Downloads/PokemonRed/Binary House/Final Structure Directory/Category/* I am using the command for f in "/media/doctor/123A123E1A123456/Users/Tim/Downloads/PokemonRed/Binary House/Final Structure Directory/Category/*"
If I am very specific about it and say "/media/doctor/123A123E1A123456/Users/Tim/Downloads/PokemonRed/Binary House/Final Structure Directory/Category/ABRA.bin" then it will work.
I am new to linux (Ubuntu) and bash, and I am struggling using google-fu to diagnose this. Every example site I can find suggests what I am doing with a wildcard should work, but they keep their examples in the same directory as the terminal / bash script is actively working in.
Before making this post, I did craft a workaround using ls which felt very roundabout because I make up my list of files in the folder and kind of go "By hand" instead of using the for loop as a succinct command. So I am looking for an answer academically why the wildcard doesn't expand in this case.
Edit: I tried the suggestion of putting the asterisk outside the double quote. But it didn't work either. Here is what I have AS OF RIGHT NOW POST-RESPONSES:
This is the copy-paste of my terminal after entering one line "bash testingfilesizecheck.sh" and hitting enter:
doctor@doctor-X570-AORUS-ELITE:~/Documents$ bash testingfilesizecheck.sh /media/doctor/123A123E1A123456/Users/Tim/Downloads/PokemonRed/Binary House/Final Structure Directory/Category/* testingfilesizecheck.sh: line 24: /media/doctor/123A123E1A123456/Users/Tim/Downloads/PokemonRed/Binary House/Final Structure Directory/Category/*: No such file or directory The line 24 comes from commenting out all the other attempts I've made in the testinfilesizecheck.sh script. Here is that script minus the commented out lines.
#!/bin/bash for f in "/media/doctor/123A123E1A123456/Users/Tim/Downloads/PokemonRed/Binary House/Final Structure Directory/Category/"* do echo "$f" actualsize=$(wc -c < "$f") done echo $actualsize Again, there is a file at /media/doctor/123A123E1A123456/Users/Tim/Downloads/PokemonRed/Binary House/Final Structure Directory/Category/ABRA.bin
But the wildcard is not expanding to accept ABRA.bin. In both variations it is just a literal asterisk. I thought, yeah, asterisk as a variable makes sense that it can't be in a quoted string based on my rudimentary understanding of other programming languages. But of course it doesn't work for me.