Determine if variable is the Server component of UNC
Hi all,
Using sh/csh, unfortunately shell scripts are not my strong suit.
Trying to write a script that gets called from a program for pre-processing.
The program passes individual components of a UNC (//server/path1/path2/filename).
Thus the unc path of: //server/path1/path2/filename, is 4 calls to myscript with each call having a single parameter of:
//server
//server/path1
//server/path1/path2
//server/path1/path2/filename
I need to be able to determine if the current component is the Server component or not. ie: //server not //server/blah.
Figured that would be easy ... Something simple like:
should get it done, Obviously I was wrong.
How can I go about this or what am I doing wrong?
The Server component will always begin with two slashes followed by a name, no trailing slash.
Non server components will always have two leading slashes, the server name followed by a slash ... and more.
If it does not start with two leading slashes it should be completely ignored.
Ruby and AWK are out ... not available.
That is the reason for my second line in original post. sh/csh!
sed is available.
I am not Reading or Processing a file ...
A Single parameter is passed to myscript, that parameter will contain ONE part of a path.
In myscript, it is referenced by $1.
I need to know if that one component (in $1) is the server part or not (ie: //server and not //server/blab) ... Thats all!
Obviously this will be used for flow control. as per my example in the original post.
Need help with the script, I am trying to include this script as part of kickstart profile.
based of the host's IP address, in this case if the host is IP starting with 10.10.3.* or 10.10.6.*, I will be pushing appropriate routing file from my web server.
I validate host IP from nslookup.
... (3 Replies)
Hello All :)
I want to write a shell script to find the file system usage on multiple UNIX servers.
Commands: df -g fsJCAPS
Below script works fine and it displays results on terminal/console. I want to store /redirect output on to local server from where I'm running the script.
... (3 Replies)
Hi Folks,
Trying to build up a script that will lookup a username invoked as:
./buildscript.sh <username>
This should take <username> and look it up in <username_file> and prepare for further processing. Here is the snippet that isn't working just right:
user=$1
if ]; then
echo... (1 Reply)
Hello,
I searched the forums and didn't see a situation like this:
I cannot figure out how to parse out just the file name from the full path. The path looks like this:
\\foo\bar\filename.ext
I don't think something like 'cut' will work so I tried to whip up a regex but couldn't get it... (12 Replies)
Hi ,
I want to connect srver to pertuculat mode(i.e.srvrmanger)and after that I want to verify status of perticular component(i.e.CommOutboundMgr)
For that I have created following script bout after 3rd line it is not executing 4th linei.e. list comp CommOutboundMgr.
cd... (2 Replies)
Is there a way for a server to determine client's DNS ip? I have an application that logs client's IP but in certain cases its desirable to know their DNS too (1 Reply)
I'm trying to use Perl on Windows (Doh!) to connect to a folder on a Domain Controller via UNC.
Right now, I have
perl -e "`runas /user:DOMAIN\\Username dir \\\\SERVER\\d\$\\Path`"
This does not seem to connect nor does it prompt for password. Should I try throwing it into a script and... (0 Replies)