LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 05-25-2012, 05:44 AM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 30
which shell script editor is better


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 ?

Thx
 
Old 05-25-2012, 06:49 AM   #2
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 343Reputation: 343Reputation: 343Reputation: 343
Hi there,

Quote:
Originally Posted by ust View Post
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, ...

[X] Doc CPU
 
Old 05-25-2012, 07:22 AM   #3
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
Quote:
Originally Posted by ust View Post
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")
 
Old 05-25-2012, 11:39 AM   #4
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
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 11:41 AM. Reason: expanded rotfl
 
Old 05-25-2012, 12:43 PM   #5
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 249Reputation: 249Reputation: 249
Me too !!!!
Vi simple ....
Lol

Gedit has code/comment highlighting too.
 
Old 05-27-2012, 08:49 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
This
Quote:
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.

Last edited by chrism01; 05-27-2012 at 08:51 PM.
 
Old 05-27-2012, 11:35 PM   #7
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,243

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
+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
 
Old 05-28-2012, 02:30 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
geany? Features summary here.
 
Old 05-28-2012, 04:49 AM   #9
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
"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.
 
Old 05-28-2012, 07:45 AM   #10
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 343Reputation: 343Reputation: 343Reputation: 343
Hi there,

Quote:
Originally Posted by David the H. View Post
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. View Post
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!
+1

[X] Doc CPU
 
Old 05-28-2012, 02:35 PM   #11
Roken
Member
 
Registered: Oct 2011
Location: Bolton, UK
Distribution: Arch local, Debian on VPS
Posts: 258

Rep: Reputation: 41
for knocking up a quick bash script, vim without a doubt. For other scripting (python, perl etc) I use geany.
 
Old 05-28-2012, 04:24 PM   #12
cryingthug
Member
 
Registered: Jun 2009
Posts: 131

Rep: Reputation: 18
+1 vim

Go with VIM. Take your time and learn it slowly. Create a .vimrc configuration file.
Vim is the sickest text editor out there.
 
Old 05-29-2012, 11:34 AM   #13
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
Quote:
Originally Posted by Doc CPU View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to pass command line arguments from one shell script to another shell script VijayaRaghavanLakshman Linux - Newbie 5 01-20-2012 10:12 PM
Executing a Shell script with 654 permissions inside another shell script. changusee2k Linux - Newbie 2 06-07-2011 08:58 PM
shell script editor with ssh capability? gvanto Linux - Newbie 2 05-15-2011 02:04 PM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 06:32 PM


All times are GMT -5. The time now is 09:54 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration