Determine if variable is the Server component of UNC


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Determine if variable is the Server component of UNC
# 8  
Old 12-31-2013
RudiC,

Absolute sweet perfection ... Much Thanks!

Never even thought of using expansion, I was way over thinking it.
I have not dissected it yet to fully understand, I will.

Took me a minute to figure out the unary operator expected error, it still worked, just gave an error.

Quoting ${1%/*} like so "${1%/*}" solved that.

My final result:if [ "/" != "${1%/*}" -a ! -d "$1" ]; then

Thanks y'all

-Enjoy
fh : )_~

Last edited by Festus Hagen; 12-31-2013 at 02:02 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to determine server IP

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)
Discussion started by: bobby320
3 Replies

2. Web Development

Script to determine which web server at ip addresses

how do we determine if ip addresses are hosting IIS version 7.x or Apache 2.2.x. ? (3 Replies)
Discussion started by: NameSake
3 Replies

3. Red Hat

How to determine share name of Linux server?

Hi, How to determine share name of Linux server ? OS version is RHL 6.5 Regards, Maddy (11 Replies)
Discussion started by: Maddy123
11 Replies

4. Shell Programming and Scripting

To determine the File Sytem Usage on Multiple UNIX server

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)
Discussion started by: Mohammad Nawaz
3 Replies

5. Shell Programming and Scripting

Determine a shell variable exists in file?

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)
Discussion started by: gdenton
1 Replies

6. Shell Programming and Scripting

Parse file name out of UNC path

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)
Discussion started by: bytesnoop
12 Replies

7. Shell Programming and Scripting

To verify status of particular Component(Siebel Server srvrmgr)

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)
Discussion started by: vivek1489
2 Replies

8. IP Networking

How to Determine client's DNS server Ip

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)
Discussion started by: vickylife
1 Replies

9. Shell Programming and Scripting

Using Perl to connect UNC Filepaths on Domain

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)
Discussion started by: adelsin
0 Replies
Login or Register to Ask a Question
shift(1)							   User Commands							  shift(1)

NAME
shift - shell built-in function to traverse either a shell's argument list or a list of field-separated words SYNOPSIS
sh shift [n] csh shift [variable] ksh * shift [n] DESCRIPTION
sh The positional parameters from $n+1 ... are renamed $1 ... . If n is not given, it is assumed to be 1. csh The components of argv, or variable, if supplied, are shifted to the left, discarding the first component. It is an error for the variable not to be set or to have a null value. ksh The positional parameters from $n+1 $n+1 ... are renamed $1 ..., default n is 1. The parameter n can be any arithmetic expression that evaluates to a non-negative number less than or equal to $#. On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways: 1. Variable assignment lists preceding the command remain in effect when the command completes. 2. I/O redirections are processed after variable assignments. 3. Errors cause a script that contains them to abort. 4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a vari- able assignment. This means that tilde substitution is performed after the = sign and word splitting and file name generation are not performed. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
csh(1), ksh(1), sh(1), attributes(5) SunOS 5.10 15 Apr 1994 shift(1)