Editing script files on unRAID from Windows machine


Recommended Posts

unRAID is my only linux machine so I'm probably not set up for script writing.  But I got really tired of editing in notepad and then copying stuff over to unRAID.  I tried running Midnight Commander (mc) in a putty session but editing files that way is tedious to say the least.  None of the keyboard shortcuts  (if there are any) seem to work.

 

So what I did is to go into unRAID menu on the shares page and make the flash drive read/write/hidden so I can directly open files on it from windows.

I downloaded this editor that has a menu named Convert where you can set it to unix mode so it saves files so unRAID likes them.  Wow, this is far easier and more comfortable for a Windows user.

http://www.editpadpro.com/editpadlite.html

 

 

Link to comment

You can edit files directly on your unRAID box if you are familiar at all with vi though it takes some getting used to if you have never used it before.

 

I have tried.  It's more than tedious to say the least.  Nice things like hightlight, cut and past, indent group of lines and all the other things *modern* editors have are conspiciously missing from vi.  Using vi is like volunteering for a flogging.

Link to comment

You can edit files directly on your unRAID box if you are familiar at all with vi though it takes some getting used to if you have never used it before.

 

I have tried.  It's more than tedious to say the least.  Nice things like hightlight, cut and past, indent group of lines and all the other things *modern* editors have are conspiciously missing from vi.   Using vi is like volunteering for a flogging.

Then try vim.org.

 

It is vi improved.  All the key-bindings for the vi crowd, and lots more, plus syntax highlighting, cut and paste, everything for the windows crowd.

 

On yes, one more thing... auto-indent has been in "vi" since forever.  Same with the ability to indent a block of code.

 

In vi the ">" and "<" operators "shift" text by whatever shiftwidth you desire.  Don't have to believe me, just open a file in "vi"

Press the escape key to be sure you are in command mode

type

1G

to go to line 1.

type

>G

to shift from where you are in the file to the bottom of the file  (Capital G is a movement command and without a numeric prefix will default to the end of the file)

 

The double "<<" and ">>" will shift the line you are on, or, if prefaced with a number, shift that many lines.

 

To set the shift-width type:

:set sw=4

 

To set auto-indent mode type

:set ai

 

In any case, vim is charityware...  It is free but the author invites you to contribute to his favorite charity cause.

 

Check it out at www.vim.org.  It is far far more than you'll need if you are just editing an occasional script or two, but perfect for those of us who grep up with "vi".  I think it even has an "emacs" mode.  ;) 

 

I load it on every windows machine I have and it works exactly as I would expect.  You do not need to know "vi" at all to use it.  It is easily usable to somebody who can use notepad.  It allows you to edit multiple files side-by-side or horizontally, and see a color-coded diff of them.

 

Joe L.

Link to comment

Use unmenu's config view/edit function? I edit the config files through there all the time and it looks like you can edit the unmenu.conf to add files you want to edit.

 

Yeah, I remember using that page and that works for the occasional change to the go script.  I needed to create/edit/run/reedit a handful of scripts though fast and easy.

 

Link to comment

Use unmenu's config view/edit function? I edit the config files through there all the time and it looks like you can edit the unmenu.conf to add files you want to edit.

 

Yeah, I remember using that page and that works for the occasional change to the go script.  I needed to create/edit/run/reedit a handful of scripts though fast and easy.

 

Well, a terminal screen like putty next to a web browser and unmenu? ie, Edit the scripts on the webpage, hit save, go to the terminal screen run it and vice versa? Once you get the script entered into unmenu and pulled it up just a matter of scrolling isn't it?

 

Otherwise, I'm not sure how you're going to get away from editing locally, then moving the file, then running it and so on and so forth.

Link to comment

You can edit files directly on your unRAID box if you are familiar at all with vi though it takes some getting used to if you have never used it before.

 

I have tried.  It's more than tedious to say the least.  Nice things like hightlight, cut and past, indent group of lines and all the other things *modern* editors have are conspiciously missing from vi.   Using vi is like volunteering for a flogging.

 

Years ago when I was first moved from the mainframe to Unix, I thought the same thing.

If you learn it. you will be able to edit on any unix/linux system anywhere.

Link to comment

You can edit files directly on your unRAID box if you are familiar at all with vi though it takes some getting used to if you have never used it before.

 

I have tried.  It's more than tedious to say the least.  Nice things like hightlight, cut and past, indent group of lines and all the other things *modern* editors have are conspiciously missing from vi.   Using vi is like volunteering for a flogging.

 

Years ago when I was first moved from the mainframe to Unix, I thought the same thing.

If you learn it. you will be able to edit on any unix/linux system anywhere.

Actually, "vi" in the hands of an experienced user is much faster for all the tasks you described... It is not a word-processor, but can be used as one.  The same goes if you are from the "emacs" religion. (You either learn one or the other... not many people learn all the features of both) 

 

"vi" is available on just about every unix/linux system out there.  I say just about, because the first 5 years I was on a unix minicomputer it had no screen editor, I was forced to use "ed," the line editor.  Bill Joy had not yet written "vi", and we were still using hard-copy paper teleprinters as terminals (Those vt100 CRTs were still years in the future too)

 

In any case, "vim" on windows is a full featured window'ed editor with anything you could possibly desire. Here it is showing a "diff" of two versions of a unmenu package, complete with syntax highlighting.  I'm editing both at the same time on the flash drive from windows.

 

300zf36.jpg

 

Joe L.

Link to comment

Hi queeg, I had the same problem, I too find vi tedious, though I use to use it before years ago when I got into Linux but I've shy'd away from it these days. I'd have to say vim is a leap forward from vi, it is more user friendly and a better alternative ti vi. I've resorted to using mc as my editor of choice. I'm supprised to hear that you didn't like it either. I find it far from being tedious, brings me back to the days of Nortons XTree which was a multi function tool back in the DOS days. I use puTTy and the keyboard shortcut work fine for me for mc, if you've got a Microsoft or Logitech keyboard, perhaps the F Keys are disabled? Anyways, good luck with your pursuit with finding the right text editor.

 

unRAID is my only linux machine so I'm probably not set up for script writing.  But I got really tired of editing in notepad and then copying stuff over to unRAID.  I tried running Midnight Commander (mc) in a putty session but editing files that way is tedious to say the least.  None of the keyboard shortcuts  (if there are any) seem to work.

 

So what I did is to go into unRAID menu on the shares page and make the flash drive read/write/hidden so I can directly open files on it from windows.

I downloaded this editor that has a menu named Convert where you can set it to unix mode so it saves files so unRAID likes them.  Wow, this is far easier and more comfortable for a Windows user.

http://www.editpadpro.com/editpadlite.html

 

 

Link to comment

"vi" is available on just about every unix/linux system out there.  I say just about, because the first 5 years I was on a unix minicomputer it had no screen editor, I was forced to use "ed," the line editor.  Bill Joy had not yet written "vi", and we were still using hard-copy paper teleprinters as terminals (Those vt100 CRTs were still years in the future too)

Joe L.

 

You are really showing your age now!!!

 

I have tried.  It's more than tedious to say the least.

 

Oh man.. it's even worse when you are down a few fingers!!!!

Link to comment

"vi" is available on just about every unix/linux system out there.  I say just about, because the first 5 years I was on a unix minicomputer it had no screen editor, I was forced to use "ed," the line editor.  Bill Joy had not yet written "vi", and we were still using hard-copy paper teleprinters as terminals (Those vt100 CRTs were still years in the future too)

Joe L.

 

You are really showing your age now!!!

Yes, I guess I am.  The chosen cursor-movement keys in "vi"  ("h","j","k","l") were because those keys had the printed arrows on the old ADM-3 terminal originally used when it was written.

450px-KB_Terminal_ADM3A.svg.png

I had one of those at one time... and I used a true vt100 for many years at work... it replaced mechanical Teletype machines (Model 35, and 33) we were previously using as the system console.

 

It is really sad when you think back and the clock speed on the CPU was 1MHz... but the CPU was room sized and built in 7 foot tall racks. 

I have tried.  It's more than tedious to say the least.

 

Oh man.. it's even worse when you are down a few fingers!!!!

I do hope you are healing... 

 

Joe L.

Link to comment
  • 6 years later...

I know this topic is old and dead but I just wanted to add my 2 cents. I use winscp to browse my linux boxes and edit them in windows. You can ssh into the machine double click the file to edit, edit it in notepad++ and just hit save and win scp will auto upload and replace the file you were working on. It is soooooooooo much easier for a windows user , linux novice to edit files and copy paste etc. It also works great for managing your files. https://winscp.net/eng/download.php

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.