Does the "tail" cmd work in CommandBox? It claims ...
# box-products
t
Does the "tail" cmd work in CommandBox? It claims to be supported and has help but when I run it for a logs file in the cfusion full path (from C:\Users\...) it just returns the path I just specified for the file to tail and then returns to the cmd prompt.
s
Isn't
server log --follow
what you're looking for? Or do you need to tail log files other than the out.log?
b
@teaman Can you show me the exact command you're running?
My first thought is that you've passed it an invalid path.
As the docs show, the first input to CommandBox's
tail
takes either the path to the file or the actual input you want to tail
So if you run
Copy code
tail C:/totally/fake/path.log
then it will just dump that back out to the console as the raw output
but if you run
Copy code
tail C:/this/is/a/real/path.log
then it will output the last
lines
of the file (defaulting to 15 per the help command)
And furthermore, if you run
Copy code
tail C:/this/is/a/real/path.log --follow
then it will follow changes to the log file until you hit Ctrl-C
t
@bdw429s tail C:\Users\me\.CommandBox\server\BB7860AC183D5A86A707C68F7D496121-wwwroot4\adobe-2018.0.15.330106\WEB-INF\cfusion\logs\FOOBAR.txt 10
b
And does that file exist?
t
Yes, I can open it fine in the OS
b
Copy code
pathExists C:\Users\me\.CommandBox\server\BB7860AC183D5A86A707C68F7D496121-wwwroot4\adobe-2018.0.15.330106\WEB-INF\cfusion\logs\FOOBAR.txt
t
That doesn't return anything
b
☝️ That command returns a passing or failing exit code, which you can see in your bullet train prompt
Or you can inspect with
Copy code
echo ${exitCode}
t
nothing returned
b
Again, it doesn't output anything. It returns an exit code.
t
echo ${exitCode}
b
Just like how ever other shell in existence works
t
Sorry wrong window. in the correct window it echoed a 1
b
That's a failure
Path doesn't exist
Is there a space in your user home directory?
t
I'm opening the file all day today in an editor
b
Like
C:\Users\Brad Wood\.CommandBox\...
t
Actually it is:
Copy code
C:\Users\bholm\.CommandBox\server\BB7860AC183D5A86A707C68F7D496121-wwwroot4\adobe-2018.0.15.330106\WEB-INF\cfusion\logs\FOOBAR.txt
b
Is there a space in the log file name? Or is it actually called
FOOBAR.txt
?
t
It is exactly as shown, no spaces
b
What does this do?
Copy code
open C:\Users\bholm\.CommandBox\server\BB7860AC183D5A86A707C68F7D496121-wwwroot4\adobe-2018.0.15.330106\WEB-INF\cfusion\logs\FOOBAR.txt
(Nothing will happen if it can't find the file, otherwise it will open it)
t
Here's a picture:
b
What's the file extension?
.txt
or
.log
?
You can run this to get a dir listing
Copy code
ls C:\Users\bholm\.CommandBox\server\BB7860AC183D5A86A707C68F7D496121-wwwroot4\adobe-2018.0.15.330106\WEB-INF\cfusion\logs\
t
that's it, It is .log
I didn't have that column visible
b
Ahh, so the file doesn't exist 🙂
t
lol
😀 1
b
The first thing I do on a Windows machine is enable file extensions
t
That fixed the problem. Thanks @bdw429s
👍 1
👍🏼 1
b
I don't care for Microsoft's child-friendly, padding-taped-on-the-corners "toddler mode" eye roll
👍🏼 1
t
😃
I strongly dislike Windows
👍🏼 1
b
I strongly dislike whatever OS I'm being forced to use at the moment.
😂 1
g
I strongly dislike Windows
I find them necessary to let the air in! 😉 On a serious note - I find myself either using powershell instead of a dos prompt (AND instead of the GUI). OR - I am in a command-box "session". Windows SUX at sooo much - and the changes they have made in Windows 11 - I REALLY hate. If it wasn't so painful to reinstall and reconfigure everything... I would install a desktop linux.
j
Every other version (in the even/odd sense) of Windows is tolerable.
g
Is it wrong to pine for DOS and desqView?