Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
We usually use vi to edit the shell script , it is easy to use , simple but seems not have much function to compare with other programming editor ,
can advise what kind of edit tool is better for edit shell script ?
selecting the "best" editor is not only a matter of fitness for a particular purpose (there are many versatile editors out there), but also a question of personal preference.
I prefer Bluefish as a text editor for most situations, whether it's batch files, config files, HTML, XML, PHP, plain text, ...
We usually use vi to edit the shell script , it is easy to use , simple but seems not have much function to compare with other programming editor ,
Thx
??
vi has a lot of options, has a lot of features, actually it is comparable with any other editor, see vim. Just you have to learn it. In a modern distro you will find it, probably it is named gvim.
_____________________________________
If someone helps you, or you approve of what's posted, click the "Add to Reputation" button, on the left of the post.
Happy with solution ... mark as SOLVED
(located in the "thread tools")
What the others said. The only thing necessary for creating a script is a text editor of some kind. Which one you decide to use is entirely up to you. The most convenient ones generally have features like syntax highlighting and regex replacement, but even a simple notepad-like one would do, if that's what you're most comfortable with. I personally used nano for many years, but now I'm slowly transitioning to vim.
And this must be the first time I've ever heard anyone call vi "simple", "easy to use", and most of all, lacking in features. ROTFL!
Last edited by David the H.; 05-25-2012 at 10:41 AM.
Reason: expanded rotfl
And this must be the first time I've ever heard anyone call vi "simple", "easy to use", and most of all, lacking in features.
Me three !!!
Anyway, vi (usually symlinked to call vim http://www.vim.org/ on Linux) for a cli env. gvim requires a GUI...
vim does come with regex, syntax highlighting, macros, split buffers (iirc) even ...
I work on various *nix and they have all come with vi (real vi) as the default editor for many many years.
Always worth knowing the basics of vi, as you may not be allowed to install others, and its also part of the recovery disks/tools for most systems as well.
+1 vi/vim ... I do like to see what others suggest and usually try them out (point in case, Doc's suggestion of Bluefish will get a look in), but at the end of the day I will go to console
or fire up an xterm and use vim when I want to get serious
"vim" and "simple" are two words that I never thought I'd see together in the same phrase.
The only editor (to call it something) that has more features is probably emacs, but I'd rather include emacs in the section of operative systems, or at least, desktop environments (even if a text-mode one). It can check your mail, manage your news, IM, chat, and file system operations. There're even games for it. All it lacks is a proper interface to udev to manage your hardware and then you wouldn't need anything else :lol:
I personally like simpler editors though.
But that's a personal preference.
In the university I used nedit. I also used some versions of vi, and I felt highly uncomfortable with it, but sometimes I had not much options at hand.
I've used profficiently bluefish (which I like a lot) and kate, which is simpler but still decent (well, haven't check lately since it became quite unstable with the coming of kde 4.x). Geany is also ok, and has a very good feature-set/lightness ratio. I also use nano though it's sometimes a pain in the ass the lack of an undo feature. jed and joe are nice text-mode editors, and midnight commander has a very handy editor, though I've never really felt comfortable with it. Qscintilla is also very good, though a bit complex.
There are lots, though. If there's *one* single thing that linux has, that's text editors. You will for sure find something that suits you.
The most convenient ones generally have features like syntax highlighting and regex replacement, ...
syntax highlighting is actually a double-edged sword. Many people like it, find it helpful, and consider it a good idea. There are others (like me) who feel that syntax highlighting distracts their attention from the important details.
If an editor allows me to customize syntax highlighting down to a very subtle accentuation of keywords (for instance with bold text vs. normal text for the rest, or just two or three different shades of gray), then I might use it. But I've often see syntax highlighting preconfigured to a wild, colored mess. If it is like that, and I can't configure it to my liking, I rather turn it off completely, because that way it's annoying and confusing.
There are other features I rate important for a good multi-purpose editor:
Search and replace with RegEx (already been mentioned), and across multiple files
Fast startup - I don't like to wait five seconds when I double-click a file
Capability of handling very large files - this is a sore point with many editors especially on the Windows platform
Brace matching
Code folding
Quote:
Originally Posted by David the H.
And this must be the first time I've ever heard anyone call vi "simple", "easy to use", and most of all, lacking in features. ROTFL!
syntax highlighting is actually a double-edged sword. Many people like it, find it helpful, and consider it a good idea. There are others (like me) who feel that syntax highlighting distracts their attention from the important details.
If an editor allows me to customize syntax highlighting down to a very subtle accentuation of keywords (for instance with bold text vs. normal text for the rest, or just two or three different shades of gray), then I might use it.
I prefer having it myself. Far from being distracting, it helps keep everything clear at a glance, and provides instant warning of missing quotes and other syntax errors. I do agree that some color combos can be a bit off-putting however, and that some implementations aren't that smart when it comes to handling complex code.
And of course vim is one that does let you customize your highlighting, and even lets you write your own from scratch. The first time I loaded the .sh syntax file in vim, I knew immediately that I had to figure out how to override a few of the default colors. It turned out to be quite easy to do, actually.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.