LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This 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


Reply
  Search this Thread
Old 11-23-2004, 09:54 PM   #1
slick_willie
Member
 
Registered: May 2003
Posts: 46

Rep: Reputation: 15
New to Solaris/csh


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
 
Old 11-24-2004, 01:43 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Cshell is outdated by ksh and bash.
I see no interest in learning it today ...
 
Old 11-24-2004, 05:23 PM   #3
student04
Member
 
Registered: Jan 2004
Location: USA
Distribution: macOS, OpenBSD
Posts: 669

Rep: Reputation: 34
i would agree... just use bash (type bash), because features in csh are less available
 
Old 11-25-2004, 01:30 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
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.
 
Old 11-26-2004, 02:51 AM   #5
]un]ie
Member
 
Registered: Jul 2004
Location: Singapore
Posts: 61

Rep: Reputation: 16
yup..
if u type "bash"..
u will find that all your queries are solve.
basically bash does all those things u mentioned.
 
Old 11-26-2004, 02:21 PM   #6
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
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.
 
Old 11-26-2004, 03:49 PM   #7
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
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.
 
Old 11-29-2004, 05:41 PM   #8
slick_willie
Member
 
Registered: May 2003
Posts: 46

Original Poster
Rep: Reputation: 15
I get this:
bash: Command not found
 
Old 11-29-2004, 07:17 PM   #9
student04
Member
 
Registered: Jan 2004
Location: USA
Distribution: macOS, OpenBSD
Posts: 669

Rep: Reputation: 34
Code:
locate bash
maybe that'll bring up something... if not:
Code:
# updatedb
and do it again... if not, then it might not be on the system
 
Old 11-30-2004, 12:28 AM   #10
slick_willie
Member
 
Registered: May 2003
Posts: 46

Original Poster
Rep: Reputation: 15
I'm such a fool, I was using ' instead of ` to enclose commands.
 
Old 11-30-2004, 01:54 AM   #11
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
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.
 
Old 11-30-2004, 05:05 PM   #12
slick_willie
Member
 
Registered: May 2003
Posts: 46

Original Poster
Rep: Reputation: 15
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.
 
Old 11-30-2004, 05:42 PM   #13
slick_willie
Member
 
Registered: May 2003
Posts: 46

Original Poster
Rep: Reputation: 15
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.
 
Old 11-30-2004, 06:54 PM   #14
student04
Member
 
Registered: Jan 2004
Location: USA
Distribution: macOS, OpenBSD
Posts: 669

Rep: Reputation: 34
Is vi installed? Try vim, emacs and others, as well.

Last edited by student04; 11-30-2004 at 06:55 PM.
 
Old 11-30-2004, 07:26 PM   #15
slick_willie
Member
 
Registered: May 2003
Posts: 46

Original Poster
Rep: Reputation: 15
I know vi is installed, because I've used it. Emacs is not installed, and I've never used vim.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting csh on cygwin saiz66 Linux - Newbie 0 09-16-2004 09:14 AM
csh problem !! StephP Linux - Newbie 1 11-14-2003 05:19 AM
installing csh? skewer Linux - Newbie 4 04-05-2003 04:10 PM
Path in csh sstrause Linux - Newbie 2 03-10-2003 02:56 PM
csh zaza Linux - Newbie 6 05-21-2002 06:26 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 07:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration