Posts: 29
rich_c
Joined: 21 Oct 2008
#1
Just written my first couple of scripts. Simple one liners to sshfs to my Mepis desktop but just about worth doing a little script for to save remembering paths etc. __{{emoticon}}__
Posts: 1,520
eriefisher
Joined: 07 Oct 2007
#2
That's what makes the shell so powerful, being able to automate things.

Share your script. Someone else may enjoy it.
Posts: 29
rich_c
Joined: 21 Oct 2008
#3
Quite willing to share! It really is just a one liner!

#!/bin/bash
sshfs <user>@host:/home/<user> /home/<user_on_local_host>/remote-home

So, on the local machine, there's a directory called remote_home in my home directory which gets the remote directory mounted on it. Save the script as remote_home & make it executable & your off! Note the directory is called remote<dash>home & the script remote<underscore>home to differentiate a bit...
eriefisher
Posts: 1,520
eriefisher
Joined: 07 Oct 2007
#4
rich_c wrote:Quite willing to share! It really is just a one liner!
Maybe just a simple one liner but someone may see it and think"what if I just......". The big light will suddenly come on and bingo there willingly using the shell.
anticapitalista
Posts: 5,955
Site Admin
Joined: 11 Sep 2007
#5
I remember feeling over the moon when I wrote my first script (it wasn't that long ago, I'm still very much a noob at it) and it worked.

Maybe we should have a thread to share scripts?
Posts: 1,520
eriefisher
Joined: 07 Oct 2007
#6
anticapitalista wrote:Maybe we should have a thread to share scripts?
Great idea!
Posts: 29
rich_c
Joined: 21 Oct 2008
#7
OK, I dug through my Linux books and produced a much more polished (IMHO) version suitable for general use! Have a look at:
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://mepislovers.org/forums/showthread.php?p=148608#post148608"
linktext was:"http://mepislovers.org/forums/showthrea ... post148608"
====================================
" onclick="window.open(this.href);return false
Posts: 1,520
eriefisher
Joined: 07 Oct 2007
#8
That's great rich_c. You could take even further if you like and use Zenity to do it graphically.
Posts: 29
rich_c
Joined: 21 Oct 2008
#9
Will have to look into that! Sounds like the next logical step!
Posts: 1,520
eriefisher
Joined: 07 Oct 2007
#10
"man zenity" will show you all the variables. Just for a look run:

Code: Select all

zenity --entry
a sneak peek of what it will do.