I was wondering if it possible to get the path of a variable and compare that to something. Basically I want to write a script that checks if my $JAVA_HOME is correct and if not then it sets it. So far I have...
Problem is that the script can't seem to understand that I want to compare the path $JAVA_HOME and not what's in there. Anyone know how to just extract the path from that already set variable? Thanks!
this statement "Be sure to have /usr/bin before /usr/local/bin in your $PATH" is because, if u have any files in bin directory, /usr/local/bin will be the first place to look at instead of /usr/bin. BUT, /usr/local/bin has one more descending directory to go , therefore /usr/bin has to come before... (2 Replies)
Hi
I have a path link
/test/df/link1/actual/file1
here link1 is actually a softlink link1= a/b
i need to print the ACTUAL FULL path instead of a linked path
is there any direct command to print the actual path of any linked path
eg
showPhyscialPath /test/df/link1/actual/file1 and it... (4 Replies)
echo $PATH | grep "\/usr\/ucb" is not working using sh-posix
The problem is very simle.
I want to check '/usr/ucb' is in the PATH environment variable.
If i simply grep '/usr/ucb' i might got wrong result eg '/usr/ucb/bin'.
After the path an end of line or colon character should be.
In... (4 Replies)
Hi,
I'm trying to write a bit of code that will check if a file exists and then archives the file
Im trying to use the following if statement without success..
if
then
mv filename archive/filename
else
echo "no filename exists"
fi
Should the file name be... (3 Replies)
Hi,
Am trying to execute certain commands if the condition satisfied, but i feel i am making some mistakes in the usage of if statement
here is the code
#!/bin/ksh
SIZE=$(ls -ltr /aemu/ws/DN.txt | tr -s ' ' | cut -d ' ' -f 5)
filename=`TZ=CST+24 date +%Y%m%d`
ZERO=0
if
then
cp... (5 Replies)
Hi All,
If i run below copy command, it works absolutely fine,
/opt/csw/bin/scp axetlxyz01:/opt/data/test/QURIES* ./input
I want to make the above line better, by adding an IF statement, want to check if there is any file exists with name QURIES*.* then i need to copy that.
if
... (7 Replies)
I have a script that will be placing a trigger file for other applications.
The user-inputted path is similar to:
"/data/region/NorthAm/Project HAV 8H"
The project path will not change throughout the script. However, pwd changes as the scanning continues in the script. I need to truncate... (3 Replies)
Hello Guys,
I am trying scp few file within if statement, but getting error, can someone please help to understand, what mistake I am making ?
if && ] ;
then
echo " Files transferred to Log servers successfully. "
else
echo " One or more file transfer failed over... (10 Replies)
Hi,
I am running a shell script that has to verify a password with an if statement. The password has an @ in it. I am having problems getting the if statement to test for the password. The @ causes problem. I tried the standard backslash escape but it did not work for me.
How can I do it?
I... (2 Replies)
Discussion started by: mojoman
2 Replies
LEARN ABOUT SUNOS
volmgt_ownspath
volmgt_ownspath(3VOLMGT) Volume Management Library Functions volmgt_ownspath(3VOLMGT)NAME
volmgt_ownspath - check Volume Management name space for path
SYNOPSIS
cc [flag]... file... -lvolgmt [library]...
#include <volmgt.h>
int volmgt_ownspath(char *path);
PARAMETERS
path A string containing the path.
DESCRIPTION
The volmgt_ownspath() function checks to see if a given path is contained in the Volume Management name space. This is achieved by compar-
ing the beginning of the supplied path name with the output from volmgt_root(3VOLMGT)RETURN VALUES
The volgmt_ownspath() function returns a non-zero value if path is owned by Volume Management. It returns 0 if path is not in its name
space or Volume Management is not running.
EXAMPLES
Example 1: Using volmgt_ownspath()
The following example first checks if Volume Management is running, then checks the Volume Management name space for path, and then returns
the id for the piece of media.
char *path;
...
if (volmgt_running()) {
if (volmgt_ownspath(path)) {
(void) printf("id of %s is %lld
",
path, media_getid(path));
}
}
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT Level |Safe |
+-----------------------------+-----------------------------+
|Commitment Level |Public |
+-----------------------------+-----------------------------+
SEE ALSO volmgt_root(3VOLMGT), volmgt_running(3VOLMGT), attributes(5)SunOS 5.10 21 Apr 1998 volmgt_ownspath(3VOLMGT)