![]() |
Installing alternate shell - is it possible, and would you recommend it? - Printable Version +- Linux Lite Forums (https://www.freecinema2022.gq/forums) +-- Forum: Software - Support (https://www.freecinema2022.gq/forums/forumdisplay.php?fid=5) +--- Forum: Other (https://www.freecinema2022.gq/forums/forumdisplay.php?fid=20) +--- Thread: Installing alternate shell - is it possible, and would you recommend it? (/showthread.php?tid=5358) |
Installing alternate shell - is it possible, and would you recommend it? - Vera - 06-09-2018 I'm considering installing csh or tcsh on my LL 4.0 system - not as my main shell, but to use on the rare occasions when I do shell scripting. I notice those additional shells are available in the Synaptic package manager. That said, a) would installing csh (or tcsh) be likely to screw up anything that is pre-existing on my system? b) would you recommend installing csh/tcsh? (a totally different question, I know). I'd love to get some guidance from the LL community on either or both of these questions. Please answer as little or as much as you are willing to - any information is helpful here. Optional background - only read if you want to know this: The reason I am even considering a csh-based system for scripting is that I used it years ago on Unix. It "made sense" to me in a way that bash (still) doesn't, but possibly that's just because csh / tcsh was the first shell I ever used. I guess I wanted to see if going back to one of those shells would make me feel more "at home" when I do any scripting. Re: Installing alternate shell - is it possible, and would you recommend it? - Valtam - 06-09-2018 Unknown effects Vera. You should trial it in a VM first. Sent from my Mi Max using Tapatalk Re: Installing alternate shell - is it possible, and would you recommend it? - trinidad - 06-09-2018 Opinions do not vary much concerning csh. Better off with bash and dash. If you want to devote time to something, it's better for you to expend your effort on the better shell and better syntax. I'm not a developer, and I still make mistakes with query definitions and </> entries switching back and forth from Debian and Apache and I use nano a lot more than I should. When you add html5, php, and a few other syntaxes in it's confusing enough and hard enough on the eyes just using 2 shells. Unix doesn't really have a static form anymore anyway, so stick with bash, where the improvements are always being made. http://www.faqs.org/faqs/unix-faq/shell/shell-differences/ TC Re: Installing alternate shell - is it possible, and would you recommend it? - Vera - 06-09-2018 Thanks so much for your answers [member=2]Jerry[/member] and [member=5916]trinidad[/member] . I'm thinking carefully on this. OK then Jerry, if I try it, I will either try it on VM, or I will back up my current files on USB so that if my system breaks I will be able to do a fresh install of LL 4.0 without losing any important data. (I'm backing up my and the other user files as we speak!) Trinidad - I read the article you recommended. In particular, I noticed that it said "The more advanced shells tend to take up extra CPU, since they work in cbreak mode". This concerned me a little, so I'm thinking about whether I want to try it out or not. If I do, I would not make it a login shell, which I realize is risky. It was certainly helpful to get this background. Thank you. I also started reading about the fish shell, which is a newer shell that I hadn't heard of before. From what I see from its website https://fishshell.com/ it looks pretty good. It's on Synaptic as well. I'm not installing anything yet, I'm thinking about the ramifications. Thanks again Jerry and Trinidad for this helpful advice. Re: Installing alternate shell - is it possible, and would you recommend it? - Vera - 06-09-2018 OK, to update the results. All went fine! I installed the fish shell via the Synaptic package manger. This was not on a VM, it was on my real LL 4.0 machine (I'd backed up user data onto a USB drive first). Please note, I did NOT set up fish as my login shell, just to be safe! I'm only planning to use fish when I do scripting. OK, here is a case in point where I'm comparing bash and fish on the "if" statement, where bash falls down under a certain condition (just a comment inside the 'if'). The "date" command in the script is just so we know when we've gone past the if statement and gotten to the end of the script. BASH: Here is a bash script I made called test-if-comment.bash: Code: #!/bin/bash Here is the output of test-if-comment.bash: ./test-if-comment.bash: line 6: syntax error near unexpected token `fi' ./test-if-comment.bash: line 6: ` fi' The output is an error because it doesn't like to have an if statement containing only a comment. This is exactly why I don't like bash. This sort of thing makes me want to cry! So in order to have the thing run, I need to put something else other than just a comment inside the if statement. OK, let's try putting an echo statement in there. We will call this file test-if-comment-echo.bash Code: #!/bin/bash Here is the output of test-if-comment-echo.bash - it's what we would expect: Placeholder text Sat Jun 9 15:08:39 EDT 2018 FISH OK, let's try the equivalent of the first shell script but in fish. We'll call it test-if-comment.fish Code: #! /usr/bin/fish Here is the output of test-if-comment.fish - evidently the fish shell is fine with just a comment inside the if statement: Sat Jun 9 15:11:28 EDT 2018 I also tested the fish script with an echo inside the if statement as well as the comment, just to make sure it was working properly, and it was. I think I will be sticking with fish for my scripting needs. It seems to work more intuitively for me. |