Solaris / OpenSolarisThis forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a couple questions as I am new to both Solaris and the c shell.
How can I make a filename auto generate with the tab key at the command prompt?
How can I scroll through previous commands?
How can I set the command prompt to display the hostname and the present working directory?
How would I write this in a c shell script?:
if 'ls /var |grep file1 |wc -l' >0; then
echo "file exists"
elif
echo "No file"
read QQQ
exit
fi
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
bash and ksh are pretty similar and mostly compatible (Posix).
bash is better under interactive use (simpler and wider completion) while ksh has better features as a scripting language and is always installed on all Solaris distributions.
bash is an extra package often missing on Solaris hosts.
Actually, while csh is obsolete, the next generation C shell, tcsh, is widely used. In fact, a couple of people I work with prefer its interactive features over those in bash or ksh. Everyone seems to agree that bash or ksh is still tops for scripting, though.
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
Usually, people preferring tcsh were previously csh users, so it's easier for them to keep their habits and I wouldn't try to pointlessly convince them, moreover it's true tcsh has bring many enhancements.
However, my advice to a beginner still is to stick with ksh or bash which both follow standards.
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
Quote:
I get this:
bash: Command not found
bash is only optionally installed on Solaris, while ksh is always there.
ksh has all the features you asked for, except the tab completion, for which it used a different method.
I found that pressing the Esc key will autocomplete (I don't like it as much as tab). I couldn't find how to scroll through previous commands. I couldn't set up the prompt correctly to display hostname as well as current working directory.
I could use some help using cron. Both as my user and su, the editor can not be found. I try setting the editor by
set EDITOR="vi"
and nothing happens, when I type
EDITOR=vi;echo $EDITOR
vi is displayed, but vi doesn't open, and it errors out, still looking for the mysterious editor that doesn't exist.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.