40 posts
Location
Inside a Linux server, waiting to EXPLODE
Posted 28 April 2017 - 06:32 AM
VERSION: 1.79DESCRIPTION:The ComputerCraft built-in shell will break if you navigate to /rom/help (CC helpfiles directory)EXPECTED RESULT:You cannot execute any commands, but you can forcefully restart or shutdown your computer via the CTRL+S/CTRL+R key combo.REPRODUCTION STEPS:- Type cd /rom/help to visit the CC helpfiles directory
- Try to execute any command (cd, ls, help, shutdown, restart, etc.)
SCREENSHOT/VIDEO:Spoiler
THIS IS NOT A BUG. PLEASE SEE SQUIDDEV'S EXPLANATION BELOW.
Mods, please lock this thread kthx
Edited on 29 April 2017 - 02:29 AM
1426 posts
Location
Does anyone put something serious here?
Posted 28 April 2017 - 07:24 AM
This isn't a bug, just a effect of how the shell works. When you run a program like "ls", it will look for the file in each element of the path. On a normal computer, the path is roughly ".", "/rom/programs", "/rom/programs/rednet", etc…
This means when you are in the "/rom/help" directory and run "list", it looks in the /rom/help directory first, finds the documentation file, and tries to execute that. However, the contents of "/rom/programs/list" is
ls will list all the directories and files in the current location. Use "type" to find out if an item is a file or a directory.
This obviously isn't a valid Lua file, and so errors. If you need to get out, just give the absolute path to the "cd" program: "/rom/programs/cd ../".
TLDR: Not a bug, just caused by weird shell mechanics.
See also
Edited on 28 April 2017 - 05:30 AM
2427 posts
Location
UK
Posted 28 April 2017 - 11:08 AM
either way, I would suggest that Dan200 should probably make the shell use the path and then local files (perhaps with local files being forced with ./fileName )
194 posts
Posted 28 April 2017 - 10:32 PM
either way, I would suggest that Dan200 should probably make the shell use the path and then local files (perhaps with local files being forced with ./fileName )
Thats how my friend and I designed our OS Vorbani. It will always point to our sbin or bin folders first (path in this case) and then you need to force local files if you even want to run them.