Is 'bash' the Chicken or the Egg?
Phillip (5527) 57 posts |
Coming from the linux world, I naturally look for the terminal to learn the machine. Star Commands helps but doesn’t replace the utility of the bash shell. Looking for the “RISCOS CLI.” |
Paolo Fabio Zaino (28) 1882 posts |
Hi Phillip, and then at the star prompt you can simply type bash Before you do that make sure the Filer has seen the !Bash application first. |
Paolo Fabio Zaino (28) 1882 posts |
Please be aware that bash shell alone won’t recreate the “Linux environment” in RISC OS, a lot of bash common commands are external and to have them you also need to install:
all available from packman |
Phillip (5527) 57 posts |
Thanks Paolo, I’ve been having a great deal of stability issues with the 5.28 upgrade. Zap is used in the command interface and it’s crashing. I’m seriously considering a total Do Over but with 5.24. When you say “make sure the Filer has seen the !Bash application first.”, I don’t know what that means. Do I need to merge something in !Boot? !System? There has to be something BIG missing from my learning materials when it is this difficult to learn something so simple as how to change to a drive/directory. I can still ride a bicycle so I believe I can also still learn a new computer arch/language. |
Steve Pampling (1551) 8172 posts |
As a clearly, regular Zap user perhaps you could do the unthinkable and use something else for a while. If your crashes turn out to be just Zap then that’s where the investigation starts – like stripping Zap down to a bare-bones minimal install and seeing if that crashes and increase the elements until a crash element is found.
In !Configure, select Boot, select “Look at”, drag !Bash to the list, click Set, Click Set. The system will “Look at” !Bash at boot time. It’s equivalent to opening the directory with !Bash in without the system seeing everything else in that directory as it runs the !Bash application !Boot file.
The info is there in the User guide, but sometimes people don’t read the guide other times they forget that it’s different to DOS/Windows or Linux and habits are hard to break. |
Chris Hall (132) 3559 posts |
There has to be something BIG missing from my learning materials when it is this difficult to learn something so simple as how to change to a drive/directory. You need !MultiTask from !Store. It monitors each directory that is opened and sets the csd to the last opened directory or the directory containing the last double-clicked file. !Store is a good resource for RISC OS software and is on the desktop (pinboard) of all Raspberry Pi SD card images. Simply double-click on it and it will list lots of free and paid-for software. The csd is the ‘currently selected directory’ or ‘@’ which also has the file system specified so that a file operation without a path name will use the csd. Using !MultiTask means you can write a BASIC programme and run it and all file references it makes will be to the directory in which that programme resides. It saves having to worry about specifying the file system and path name. Obviously if you specify a path name expicitly (e.g. SCSI:0:$.HardDisc.fred) it will use that. If you catalogue a directory (*. or *cat) it will show you the csd as well as the current library directory (csl or %). The RISC OS 5 User Guide is only provided with ROD SD card images. Note ROD, ROL and ROOL are different entities. The RISC OS Six User Guide from ROL is available here but note that in this context Six < 5. |
Paolo Fabio Zaino (28) 1882 posts |
@ Phillip
Can you elaborate please? For instance, if you are used to Linux, why don’t you try LineEditor instead? It works in a very similar way to GNU readline, so it should be more familiar to you. You can find LineEditor here:
Steve Pampling already answered this, so just adding a little useful trick. Given that all the Unix Shell tools gets installed by default in [bootDisc].$.Apps.Utilities I’d suggest to just make sure to add that directory in your boot look up. To do that follow Steve’s instructions and just put the $.Apps.Utilities directory in the Configuration → Boot → Look at window. This will ensure that !Bash and all the other tools are seen from boot time so you just need to open a TaskWindow, type bash and you’re good to go :)
So, remember RISC OS was created before many standards in the matter of shell/help etc. came out, so it does have its own way of doing things. For example in RISC OS to change directory or change drive you can use the same CLI command:
To change directory you can type:
new_directory_name can be expressed as relative name, so just a name of a directory directly reachable from where you are at the moment or absolute which means you also specify the full path including the disc name and even the filesystem name. So (for relative paths):
While for absolute paths:
Where ADFS is the FileSystem name, ::4 is the Drive id (usually 4 is for the boot Harddisc, but this is not an absolute rule), $ symbol is for the root directory (like in Linux we have “/”) and the separation dots (dashes) are used as the path separation character in Linux (“/first_level_dir/second_level_dir/”). RISC OS also has an “help” command to display some help for each commands, but this is no way near the quality of Linux man and Linux info, so it’s a very “early days” in-line help. However if you use bash also the directories browsing works like on Linux, so you should be good to go immediately. BTW as mentioned by Chris there is plenty of documentation on line so what exactly are the difficulties you are having? |
Chris Mahoney (1684) 2165 posts |
Another way to change directory, which is sometimes more convenient, is to open the desired directory in Filer, then choose Set Directory from the menu. This will change the directory of the active TaskWindow (although I haven’t tested this with MultiTask running). If Zap is proving unstable then you can quit it and run Edit instead. It’s more bare-bones but it’ll host a TaskWindow and should be stable. |
Phillip (5527) 57 posts |
It’s hard to say exactly what difficulties I’m having. I can say that I get errors, when running apps, that I have no way of investigating without a deeper knowledge of the OS. I could tell right away that RISC OS was not going to hold my hand while learning its secrets so, I ordered the epic nutpi user manual combo about a year ago. I’ll admit I haven’t committed fully to the value of learning Risc OS. I’ve been using Linux for 25 years and pretty happy exploring the distros and window managers but, lately my focus has changed to smaller, faster, low power computers and whatever OS they’ll run. I’ve read online docs and the RiscOS5 manual till my eyes bleed but very little I’ve read addresses fixing problems. Most of the docs assume you’re having a great time with the app. Problems? Contact some long gone email address. In the Risc OS 5 manual, I found the single sentence that mentions the Look At function in the Configuration menu. Without your help in this forum, I would not have understood that sentence to mean “the filer sees it”. Best I can assume is that this is instead of a header file in the program? I’ve given up on getting bash to run, tried graph task and F12, both lock it up hard. Graphtask is unstable! On startup it reports; In GraphTask, when I type: help Commands , I get get a screen of info, no direction how to proceed, scroll? it just sits there but the system remains running, try to close it and the system crashes hard (unplug it hard). Doing the same in the CLI (^F12) crashes the whole system immediately. Type bash in either manner has the same outcome. Line edit sucks! That’s going TOO far back in time. I’m not looking for an editor, I use StrongED, I mention Zap because somewhere it is registered as the default editor so when I try to view a file, it opens Zap, gives an error and then crashes. Sometimes two or three times before it runs. If I can change the default app to StrongED, or figure out how to use the CLI to view directories and files, Zap won’t open and that problem goes away. cd or chdir = dir Lots of good info, thanks guys. |
Julie Stamp (8365) 474 posts |
Here’s a few more.
|
Steve Pampling (1551) 8172 posts |
There’s a shortcut key for that |
Dave Higton (1515) 3534 posts |
Applications normally have a !Boot file. “Look at” causes the !Boot file to be executed. As a minimum, !Boot will normally include an Iconsprites command, which adds the named set of sprites to the Wimp sprite pool, which in turn makes the Filer display the app with its sprites. There are often other lines, perhaps to specify running the app when a particular filetype is double-clicked or when a particular USB device is plugged in. |
David J. Ruck (33) 1636 posts |
Remember there is only one CSD, so if you are running a program in a task window which is working on files in the current directory, and you change the CSD inadvertently with !MultiTask, things will go wrong. |
Paolo Fabio Zaino (28) 1882 posts |
@ Phillip
I am starting to understand… May I ask you on which SBC are you running your ePic RISC OS distro? Or are you running something you crated your self? Sorry for the many questions I am trying to understand what exactly is happening on your system/device. I can run Bash and GraphTask totally fine on the following devices:
While they have issues or don’t work at all on:
Given that you’ve mentioned the ePic card, I guess you are using an Rpi 3? For !Zap I would recommend you install the latest !Zap from Rick, release 1.49 build rick 07 (it should be available on the !Store) About the traditional RISC OS CLI, yup not a bad idea the commands conversion, remember to add the file system naming differences and the FileType field that does not exists in Linux ;) |
David J. Ruck (33) 1636 posts |
Just tried that, and you are correct it does hang, but just press shift to make it scroll. This is called paged mode, and goes back to the BBC Micro, but is far less than obvious when you are on the desktop. Instead of a command which produces many screen worth of output scrolling past without you being able to read it, it pauses at the end of the screen full for you to press shift, a bit like using I could filter out the paged mode control character (ctrl+N) in GraphTask, but as it’s not a terminal, there isn’t anyway to scroll back up to what has gone off screen, so it’s actually useful – but only if you know it is there. |
Andrew McCarthy (3688) 606 posts |
Perhaps, try 5.29 09-01. Did you upgrade with HardDisc4/5/28/zip? Or was it a fresh install? Test, check your media is working (SDCard, USB device (pen drive,…)) (Disc icon → Menu → Verify) Press the scroll wheel on your mouse whilst the pointer is over the disc icon. Select Verify from the Menu by clicking the left mouse button. Note: It will take time to complete and you won’t be able to open the drive whilst its working. If there are a lot of errors, replace the card. Also !DiscKnight is another verification and recovery tool, well worth buying from the !Store. My set-up works well. RPi, SD-Card (ROM) + USB pen drive (Hardisc4) A part from a few known issues, !Zap also works well for me. The following commands are useful to know Set Debugger$AnnotatedFile $.excdump You can copy them into an Obey file (textfile, saved as Obey), then dragndrop the file onto a TaskWindow. When a program crashes it will create a text file called excdump. It’ll provide any developer with useful Intel, when coupled with your set-up details and what you were doing at the time. If you can find and report the exact sequence of events, this will also help. If you are looking to do some coding on RISC OS then I would also suggest you also download (!PackMan)
FileUtils is a great set of tools that’ll help you feel more at home on the command line, even if your not planning to do any coding. ;) Pro-tip: a full-stop and a press of the return key at the command line will list the contents of the current directory. :D |
David Pitt (3386) 1248 posts |
Hope this may help. P.S A patched P.P.S. I tried a build of |
Phillip (5527) 57 posts |
Thanks Julie, I’m working on Editing the StarComms doc to relate RISC OS commands to Linux and DOS. I’ a big fan cheat sheets! If it helps me learn, there may be others that can benefit as well. “Given that you’ve mentioned the ePic card, I guess you are using an Rpi 3?” “For !Zap I would recommend you install the latest !Zap from Rick, release 1.49 build rick 07” If there are programs that are a no go on RPi3 4 …, wouldn’t it would be nice if system requirements were available in Pakman or !Store prior to download? Some package descriptions do include target platform information but, without specifically stating that it will run on RPi, new users are prone to abandon what appears as a rough cut OS with a repository filled with broken software. With generations of versions of hardware and software it becomes a technical nightmare to participate in the revival of RISCOS. |
David J. Ruck (33) 1636 posts |
I’ve been running GraphTask on the mini.m, 3B, 3B+ and now the 4B with RO 5.28. I’m pretty sue there isn’t anything up with it apart from the paged mode gotcha, and if you try to break out of any type of Task Window in that situation, it is likely crash the RISC OS. |
Rick Murray (539) 13851 posts |
FTFY. ;-) |
John WILLIAMS (8368) 495 posts |
Rick, if you look that up you will find it has a rather more offensive meaning as well – which is possibly why dear Mr PamPling always uses it in full rather than as you have! |
Phillip (5527) 57 posts |
I have verified the ePic card. Checks OK! Anything I can point and click on in the GUI, it’s pretty likely I’ve found it and played with it. |
Andrew McCarthy (3688) 606 posts |
In context, it was spot on! ;) How on earth do I get the alternative meaning out of my head! Thanks!
That’s great. I was initially bemused, frustrated by a number of things I’ve encountered but over time they’ve either been fixed or have improved. Some of those things have failed for RISC OS, but not on other systems. You can look at that one of two ways. I decided to look at it, had it not behaved like it did on RISC OS. I wouldn’t have realised that the issue was a failing USB cable. I’m happy with that, because I’m now using a wireless mouse, so much better. :) A couple of programs worthy of a mention and not listed above are !ChatCube
You’re welcome ;) |
Paolo Fabio Zaino (28) 1882 posts |
@ David J Ruck
Which release of GraphTask? My copy is release 4.03 (05-Feb-2009) and it kinda run on the Rpi 3B+, but every time I open a new task I get the Illegal Instruction signal. Some most likely a build that has a SWP instruction in it? However it seems that that error is not a show stop, but I guess that error is what Phillip was referring to. if you want we can have a debug session on ChatCube. |
Paolo Fabio Zaino (28) 1882 posts |
@ David Pitt
You are correct, but it’s not just bash, it’s the whole set of unix CLI tools that appears to be compiled with the SWP instruction… for instance also ls in the !CoreUtils or uname etc… I’ll have a look in the GCCSDK, but yeah quite few rebuild needed :D |