• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

xubuntu mounting network shares

Fayd

Diamond Member
i'm trying to mount network shares in xubuntu karmic on my laptop.

i have windows vista x64 sharing several folders that i set up for my laptop to access. i tried pyNeighborhood and Gigilo, and neither one can see the other computers on the network. edit: i also tried jftp.

in pyneighborhood, the error was "couldnt scan workgroup" or similar, and when i gave it the computer details explicitly, it couldnt scan the computer.

anyways...

i looked online for a guide, and found a command that lists all the shared resources avail to me. it found all the other computers and their shared folders. i also confirmed the IP address and whatever i needed.

i found another guide to mounting network shares at the command line. so i set up a bash shell script to mount the network shares.

#!/bin/bash
sudo smbmount //192.168.xxx.xxx/stuff /mnt/stuff username=Guest,password=,uid=username

the problem now is, whenever i run that script (sh mntstuff.sh) it asks for a password. this isnt necessary, simply entering clears the password prompt and it works. (it works the same if i put anything in the password space. still asks for password.)

so all i'm asking really is how to enter past a password prompt in a shell script. because if i could do that, i could line all the shares up in 1 script and run it whenever i connect to the network.

i dont want to set this up in /etc/fstab, because this is a laptop that doesnt always have access to the shares. so i dont want to go through the long process of erroring out every time i start up.

as an aside... let's say i have around 120k image files in a very large file tree. i want to copy them to another folder...how would i go about doing that with the terminal? in windows i would have used robocopy /mir... but...yeah.
 
Last edited:
im not much on scripting but im going to guess that yours asks for a password because you have sudo in the script. take it out, if you need sudo to do the tastsk, you run the script as sudo

sudo ./mountstuff.sh

if youre going to be working on the cli some, you should just go on and be familiar with it.

http://www.linuxcommand.org/index.php

if youre in the directory from which you want to copy things

specifically http://www.linuxcommand.org/lts0050.php will walk you through file manipulation. its not very long and itll be better than me explaining it.
 
im not much on scripting but im going to guess that yours asks for a password because you have sudo in the script. take it out, if you need sudo to do the tastsk, you run the script as sudo

sudo ./mountstuff.sh

if youre going to be working on the cli some, you should just go on and be familiar with it.

http://www.linuxcommand.org/index.php

if youre in the directory from which you want to copy things

specifically http://www.linuxcommand.org/lts0050.php will walk you through file manipulation. its not very long and itll be better than me explaining it.

i'm really lost on scripting. looking at it now makes me remember why i failed out of computer science.

anyways, i'm gonna use your suggestion for mounting stuff.

atm i just copypasted the directory, i suppose in the future i'll need to figure out the right way.

atm i'm annoyed that comix doesnt allow for moving to the next directory, only the next archive. so i need to figure out how to .tar all the folders in a folder... individually. *sigh*

i read most of that page, but i didnt see anything relating to how to deal with filenames as variables. i could use [[digit]][[digit]][[digit]], since the chapter names are all nicely titled 001,002,003 etc. some oddballs unfortunately, though.. so that makes that difficult.

...but i just got hamana to work under wine, so i guess i dont need to bother.

edit: looks like i have to figure this out anyways. i can't get hamana to work when calling it by opening the file. i have to explicitly call hamana before opening the file through hamana.

with regard to taking the sudo out of the shell script and just running the script as sudo, it still asks for a password. i'm guessing that's because i'm mounting a network share.

oh well. i just have to hit enter 2x, and it's fine.
 
Last edited:
i think i might have a breakthrough...

for folder in $pwd

tar -cf (uh.... how do i insert the folder name variable that the for loop is on?).tar (folder name)

edit: nope, failed.
edit2: got it.

for i in *; do tar -czf "$i".tar.gz "$i"; done

...now if only i could run it from the main manga directory and tell it to go one level down through all the series directories.

edit: i googled and found this: http://sidux.com/PNphpBB2-viewtopic-t-9922.html

someone on there uses an if-then statement to determine whether the subject in the loop is a directory or not. i understand that. since i'm not dealing with non-directories, i took that out and it's working fine. however, it would not work till i took the fi; out of the command as well. am i correct in guessing that's the break in that ends the if statement? like an else?

and i dont understand why * instead of $pwd. admittedly, i havent tried that yet.

lol, i'm an idiot. i get it now.
 
Last edited:
Back
Top