|
Programming C, bash, Python, Perl, PHP, Java, you name it. |
|
Thread Tools | Display Modes |
|
|||
Csh - range expansion?
Hello,
There is very simple feature of the bash shell: $ echo {0..9} 0 1 2 3 4 5 6 7 8 9 I want to use it in CSH. I've read the man page and searched Google, but didn't find anything on 'range expansion'. Maybe my english is so wrong that this operation is called something different? How can I do this in csh? |
|
|||
Side note: you should not make/attempt any programming in (t)csh.
http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/ Use Bourne shell instead. |
|
||||
(I agree on the "don't program with csh" bit.)
I don't know of a csh feature to do this, but you might use the port misc/seq2.
__________________
Kill your t.v. |
|
|||
Then why tcsh is the default shell in FreeBSD?
|
|
||||
There is no concept of a "default shell" beyond the programs you use to automate the process of adding new users, such as in adduser.conf and pw.conf to set defaults for adduser/pw. Looking at the adduser script, I would think pardoning setting a default shell in their configuration files, that adduser defaults to /bin/sh and I've no time to hunt down what my beloved pw defaults to if anything.
In fact, /sbin/init defaults to /bin/sh for single user mode. Once upon a time, the C Shell was considered more usable for interactive work then the original Bourne Shell. Things like job control, command history, aliases - which eventually became ubiquitous through csh. The by modern standards, the tcsh is much better then the /bin/sh on FreeBSD, which is closer to the SVR4 Bourne Shell then what you would find on earlier research unix or bsd unix systems. The original C shell was also a BSD thing, so go figure...
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. Last edited by TerryP; 3rd November 2008 at 08:14 PM. |
|
||||
Quote:
Code:
% jot -s ' ' - 0 9 0 1 2 3 4 5 6 7 8 9 tcsh is (in my opinion) an excellent interactive shell, it supports most features bash does, and generally just works well. However, (t)csh is not a very good scripting language, as stated above, this is a entirely different task, FreeBSD has /bin/sh for that.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
|
||||
Quote:
So to OP I would recommend jot.
__________________
Kill your t.v. |
Thread Tools | |
Display Modes | |
|
|