Yes the share mounts perfectly with that command with the ip address in it and the text file does contain the correct ip address but when i tried your code i got the errors listed in my last post. There is something just a little wrong with the syntax of that code or i have copied it out incorrectly. Can you see any mistakes anywhere either in the original code or in mine? The code i posted is cut and paste directly from my script so that is exactly as it is there.
Thanks for persevering, Hiro.
---------- Post updated at 06:23 PM ---------- Previous update was at 07:12 AM ----------
I've done a bit more playing and come up with this:
As you can see i have commented out the line i thought was troublesome and told ip to have the ip address as it's value. For some reason, presumably the syntax i used it ignored the first character so i just banged another one in there and that gave me a print on the screen of the ip address i wanted. I had the last line commented out at that point as i didn't think it was the problem and as soon as i uncommented it the share mounted.
I think this proves that the first line is to blame? Can anyone shed any light?
Danmero, i am a little, make that a lot confused by your code, is that to replace both of the original lines or just the second one? I ran it on it's own and got an "Unexpected end of file error" but i think maybe it needs the first line to set the variable "$ip"? Is this right? If so it won't work now as the first lines seems to be at fault.
hiro,
what are the results of following two commands:
The output should be the same, namely the ip address from the ipaddress file.
In this case you can assign this ip address to a variable called ip like this:
If you want to assign the ip address to a variable called ip:
This is how I tested that:
HTH
Success at last! Unfortunately i had made another silly mistake, remember how i had plain brackets when i first typed the code in and i then changed them to curly brackets? Well i changes both pairs but your latest post with the colour coding soon put me right and it now works a treat. All i need to do now is neaten the script up a bit and my first ever attempt at scripting will be a useful tool for me.
I couldn't have done it without your help so thank you very much for your patience, Hiro.
I'm looking to write a script that takes a .txt filename as an argument, reads the file line by line, and passes each line to a command. For example, it runs command --option "LINE 1", then command --option "LINE 2", etc. I am fetching object files from a library file, I have all the object file... (2 Replies)
Hello
Does the unix korn shell provide a function to convert number entered in command line argument to text or Character so that in next step i will convert Chr to Hex (6 Replies)
Say I have a text file, with several lines. Each line may contain spaces or the # symbol.
For each line, I want to pass that line as the path of a file, in order to add it to a tar file.
I've tried this but doesn't work:
cat contents.txt | xargs -0 `tar -uvf contents.tar $1`Any ideas?
... (3 Replies)
I am trying to build a sinkhole for BIND. I created a master zone file for malicious domains and created a separate conf file, but I am stuck.
I have a list of known bd domains that is updated nightly. The file simply contains the list of domains, one on each line:
Bad.com
Bad2.com... (4 Replies)
Hi
I need to write a Perl script that the file given as first argument of the command line that will find all occurrences of the string given as the third argument of the command line and replace with the string given as the fourth argument. Name newfound file is specified as the second... (3 Replies)
Hi,
Well my title isn't very clear I think. So to understand my goal:
I have a script "test1"
#!/bin/bash
xvkbd -text blabla
with xbindkeys, I bind F5 key in order it runs my test1 script
So when I press F5, test1 runs.
I'm under Emacs/Vi and I press F5 in order to have "blabla" be... (0 Replies)
Hi,
I got a line of text which has spaces in between and it is a long stream of characters. I want to extract the text from certain position. Below is the line and I want to take out 3 characters from 86 to 88 character position. In this line space is also a character. However when using cut... (5 Replies)
hi. i'm using ksh with set -o vi. if i am far down in a directory and try to edit the command line (esc-k to retrieve previous command) the cursor is being positioned over to the left on top of the directory text making the text very difficult to read or work with. seems to be problem with long... (2 Replies)
I want to be able to call in my file and make it do it's magic by basically giving it:
FileNAME.pl searchTerm fileToSearch
It runs, and gives me the answers I want, however, it gives me an error:
Can't open GAATTC: No such file or directory at .//restriction_map_better.pl
line 15... (2 Replies)
I am having to do a lot of searching thru files to replace words. Is there a command that i can run that will alow me to hunt thru a group of files and replace one word with another without having to open each file idividually?
-thanks;) (1 Reply)