Answer the question
In order to leave comments, you need to log in
Why is the variable expanded with quotes or trying to transfer files right away?
Hello
Script:
#!/bin/bash
filex="*.pdf"
folderp="/path/to/folder"
find "$folderp" -type f -name "$filex"
find "$folderp" -type f -name "*.pdf"
Answer the question
In order to leave comments, you need to log in
In fact, your design should work and it works quite correctly for me.
Can you give an example of the output and make sure that at least one pdf file is in the right directory?
Are you sure you have *.pdf files in the specified path? Maybe there file.PDF ?
it doesn't find anything because the second variable is expanded with single quotes '.pdf'
-x
to #!/bin/bash
so that the shell writes what it is going to execute in order to understand what's going on. I suspect some funny options in .bashrc/.bash_profile
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question