Variable stops file extension being included in filename
The script below has 2 versions one works and one does not, I have even re-saved the one that works as the one that does not and it still produces the same error. So in essence it was the same script even writing to the WORKING directory but the issue still persists.
WORKING Code:
#!/bin/bash Code:
#!/bin/bash |
Best way to start debugging a shell script is to run it with debugging switches like
Code:
/bin/bash -vx /path/script --any-args 2>&1 | tee /path/debug.log Code:
less "/path/debug.log" As far as basics goes I would always ensure variables are quoted properly, there's nothing else in your script that could indicate a problem: Code:
#!/bin/bash Code:
function howto() { echo "Bash scripting guides: |
I tried the variable with braces and that provided no joy. Is it possible there could be an issue with the file? As I am creating the file on windows? I am clutching at straws because the variable passes through the data as expected, but just leaves off the .sql.gz which is static text, really baffled.
|
Saying "provided no joy" in response is not efficient and neither was leaving out the microsoft part. Show debug output instead.
|
By tried and no joy I meant I had tried prior to posting on the forum and this not resolve the issue I encountered. As for the windows, the file is created on Windows 7 and then ran on Shared Hosting Linux platform(1&1), if that bares any relevance? Anything else I may have overlooked that would potentially explain this issue?
To be honest I am not knowledgeable enough with bash to attempt to debug, or to even follow you recommendations. If I find a decent tutorial to follow I will give it a go. Thanks for the help! |
Quote:
Quote:
|
The dos2unix done the trick, thanks for the help much appreciated!
|
OK, thanks for the feedback. Please marked the tread solved.
|
All times are GMT -5. The time now is 11:56 AM. |