/dev/chat

General discussion for unix.stackexchange.com. If you have a q...
Apr 25, 2016 14:08
replacing the space in the server path with "%20"
Apr 25, 2016 14:08
nvm, this is the one that did it for me: hintspace.blogspot.com/2014/02/connecting-to-smb-share.html
Apr 25, 2016 13:52
could you demonstrate?
Apr 25, 2016 13:50
I take it back, I'm still getting the same error when I remove that part of my password anyway. By removing that portion of the password I was hoping for an authentication failed error. But I'm still getting the URL parsing failed error described before
Apr 25, 2016 13:47
so how would I get it to not split my password up in a wierd way
Apr 25, 2016 13:47
the ! in my password is the last character... so as you can see, it treated the first part as part of the mount_smbfs command, then split on the "!" to the space
Apr 25, 2016 13:46
ok, next problem when I quote it. My password has "!" in it, so bash interprets that as a declaration and splits the string automatically and gives me an error like so:

-bash: [email protected]/Shared/Information: event not found
Apr 25, 2016 13:37
any ideas how I can make the space evaluate properly in OS X?
Apr 25, 2016 13:36
Hey all, I'm having an issue with mount_smbfs and having a space in my path. My mount path looks like this:
'smb://cofarmer:[email protected]/Shared/Information Technology1/Interoperability' '/Volumes/Interoperability'
and I'm getting an error stating: "mount_smbfs: URL parsing failed, please correct the URL and try again: Invalid argument"
 

 Ask Ubuntu General Room

Normally: General discussion around Ask Ubuntu, Ubuntu & offic...
May 9, 2014 05:28
later guys
May 9, 2014 05:27
lol
May 9, 2014 05:27
yea, 30 more seconds...
May 9, 2014 05:26
?
May 9, 2014 05:25
what I do know, is that this exercise made me learn about bash subshell variable scopes which is something I didn't know about before.... so there!
May 9, 2014 05:24
I don't know enough to debate you at this point
May 9, 2014 05:23
nothing wrong with that -- awk seems pretty powerful to me. sed does too, but thats a confusing nightmare right now... I'm sure I'll be getting into it next though
May 9, 2014 05:23
psh
May 9, 2014 05:22
yea I know, I've actually already done it in python awhile ago... I just thought it would be a good exercise to do it in bash
May 9, 2014 05:21
:p
May 9, 2014 05:21
because thats python fool! and I wanted to learn bash
May 9, 2014 05:19
night everyone
May 9, 2014 05:19
alright, my Low Battery notification just popped up and I'm too lazy to get the power cable so...
May 9, 2014 05:18
now, it would be cool to make my first command cross-platform compatible but since I will only be using this on mac boxes that I will be deploying I'm not really that worried about it
May 9, 2014 05:17
thats much easier because ip route has the information in debian, but ip doesn't exist in mac :(
May 9, 2014 05:16
heres the one I made for debian:

echo $(/sbin/ip route | awk '/eth0/ && ++i==2 { print $1 }')
May 9, 2014 05:16
hmm, sounds like the ordering of the interface info might be mixed up between OSs too
May 9, 2014 05:14
haha, what does it do?
May 9, 2014 05:14
so you got it then?
May 9, 2014 05:13
@hbdgaf then it must be due to bash differences
May 9, 2014 05:12
it should work without the "net" part as well because "mask" is unique in each interface block
May 9, 2014 05:10
@hbdgaf yea? what about it?
May 9, 2014 05:09
try and let me know please, if it still doesn't work it is bash version differences
May 9, 2014 05:09
@hbdgaf did you change en0 in both places?
May 9, 2014 05:08
mac doesn't have another way to get cidr formatted ip range so... this is my current solution...
May 9, 2014 05:07
well here is what I've got so far (mind you I'm working on a mac so you'll simply have to edit the `en0` interface to `eth0` if you want to run this on ubuntu) but it converts your ip address + subnet mask to cidr format:

while read y; do echo ${y%.*}".0/$(m=0; while read -n 1 x && [ $x = f ]; do m=$[m+4]; done < <(ifconfig en0 | awk '/mask/{$4=substr($4,3);print $4}'); echo $m )"; done < <(ifconfig en0 | awk '/inet[ ]/{print $2}');
May 9, 2014 05:06
@chaskes boooo
May 9, 2014 04:58
...possibly...
May 9, 2014 04:57
yet you asked the question anyway
May 9, 2014 04:56
looks more like espanol
May 9, 2014 04:55
next question, subshell string manipulation using substring... this works perfectly fine:

echo $(ifconfig en0 | awk '/netmask/{$4=substr($4,3);print $4}')

but for academic purposes, I'm trying to condense using the other substr notation `${"$4":3}`, how could I use this notation in the command above?
May 9, 2014 03:33
yea I found the reason why but I don't see a solution yet that will work with the command sequence I'm attempting to do
May 9, 2014 03:30
@chaskes yes yes +1
May 9, 2014 03:28
found the answer to my problem: stackoverflow.com/questions/16854280/…
May 9, 2014 03:24
@Lucio good find
May 9, 2014 03:22
@Lucio:

MASK=0; echo "$(ifconfig en0 | awk '/netmask/ {split($4 ,a,"x"); print a[2]}')" | while read -n 1 bit && [[ $bit != 0 ]]; do MASK=$(($MASK + 4)); echo $MASK; done; echo $MASK
May 9, 2014 03:22
so, why would a bash variable altered within a while loop not carry over the final results to the outside of the loop?
May 9, 2014 03:20
...redacted
May 9, 2014 03:18
Evening...
May 9, 2014 03:18
haha
May 9, 2014 03:18
whats your ip?