topic title: Feeling a bit pleased with myself...
10 posts
• Page 1 of 1
-
Posts: 29
- 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
- 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.
Share your script. Someone else may enjoy it.
-
Posts: 29
- 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...
#!/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...
-
eriefishereriefisherPosts: 1,520
- Joined: 07 Oct 2007
#4
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.rich_c wrote:Quite willing to share! It really is just a one liner!
-
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?
Maybe we should have a thread to share scripts?
-
Posts: 1,520
- Joined: 07 Oct 2007
#6
Great idea!anticapitalista wrote:Maybe we should have a thread to share scripts?
-
Posts: 29
- 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
========= 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
- 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
- Joined: 21 Oct 2008
#9
Will have to look into that! Sounds like the next logical step!
-
Posts: 1,520
- Joined: 07 Oct 2007
#10
"man zenity" will show you all the variables. Just for a look run:
a sneak peek of what it will do.
Code: Select all
zenity --entry