linux - Bash returning a no such file when file exists -
I am trying to run the grep command on the log file to capture the URL for some functions. The problem is that I do not give it to so I I am really confused about what is happening, I have also tried to change the EDIT: Here is the full output for a repetition of the loop: I think it is a bit weird that Cause its "plain" hered A, SSA : You can not do this because your code relies on expanding the local directory to change any such file or directory error whenever I try to run it, I thought it was weird because I used to call it
ls To see it before did it whether it exists and take it and it is actually there. Someone can tell me what the problem is, I think this is a syntax problem which I do not know about but I can not understand it.
#! In / bin / bash `Sack 1 3`; Do ssh user@member${i}.domain.com & lt; & Lt; EOF CD / Home / Path / Member $ {i} / Logs LS # I have printed the output of the trial = $ (grep-oP "http :./Microwebapp/ $" "messages.log") given below "Exam" The output of the
ls command is given below:
console log messages.log status.log trace.log
"message.log"
"No benefit from ./ messages.log"
grep: ./messages.log: No such file or directory has not allocated pseudo-terminal Because stdin is not a terminal Console.log messages.log status.log trace.log test variable =
grep Command runs
ls but I have no explanation for this
test = $ (grep -op "http: / /> ) to control shell hands before your local machine, before < . * Microwebapp / $ "" messages.log ") Try echo" test variable = $ {test} "
Ssh user @ Member $ {i} .domain.com & lt; & Lt; Eoff CD / home / path / member $ {i} / logs LS # I have printed the output of the following test = = $ (grep -oP "http :. * Microwebapp / $" "messages.log") #. ... ^ "Test Variable = \ $ Test" echo # ..................... ^ exit EOF
< P> By "plain" heredoch, I mean the word that terminates is not solved. One can put a single quote around the word, and effectively single itself extends the whole headococcus:
ssh remote_host & lt; & Lt; 'End' # ............ ..... ^ ... ^ h = $ (hostname) d = $ (date) echo $ h at time $ d END
$ i in the correct directory.
Comments
Post a Comment