Hi
I am trying to use sed to retrieve part of my html file's path. I am having a hard time getting what I want. Could someone give me some help?
I want to retrieve the section after html and before the file name
For example if I have the following,
/home/folder1/html/home/house/Home.html@@/main/
What do I need to do to get
home/house
I have tried
but I can't remove the file name.
Any help will be greatly appreciated
Last edited by Franklin52; 03-23-2009 at 05:24 AM..
Reason: adding code tags
Seems I'm inundating this forum with questions, but anyway:
I am writing a script that should accept one and only one argument when called.
That argument should designate a file, either with path/filename or just filename.
Now to the difficult bit:
I want to figure out a way to store... (9 Replies)
Hi all,
Does anyone know how to ammend the .cshrc file in $HOME for your session to display the path as part of the command line? So that I dont need to keep on typing pwd to see where I am?
thanks
Ocelot (3 Replies)
Hi
I have a word assigned to the variable, for example:
A=TTOP
Is there a way to remove the first letter from this word and assign the rest of the word to another variable, so the output would be like this:
B=TOP
Thanks a lot for any advice.... -A (2 Replies)
Hi all,
I am learning the use of regular expression and I would like to know which regex can be used to select only the last part of a directory path name.
Something like:
/dir1/dir2/dir2
and I want to select the last /dir2 where dir2 can be any kind of string.
Thanks a lot for your help.... (7 Replies)
Hi
I have two path as follows
system/console/bin/code/sample/testfile.txt
system/console/bin/database/files/new/dbfile.txt
I need the output as
code/sample in first case
database/files/new in second case
That is I am omitting system/console/bin and the filename(s) in both... (2 Replies)
Let say I have /home/user1/bin/ and i want it to be /root/bin
I tried : s/\/home\/user1/user2/
but it can't find the pattern user1.
I tried: s/*\/home\/user1*/user2/
as well same result
many thanks (4 Replies)
Hi,
I have a file abcd.txt which has contents in the form of full path file names i.e.
$home> vi abcd.txt
/a/b/c/r1.txt
/q/w/e/r2.txt
/z/x/c/r3.txt
Now I want to retrieve only the directory path name for each row
i.e
/a/b/c/
/q/w/e/
How to get the same through shell script?... (7 Replies)
I'm trying to replace path which is part of variable inside script file:
FROM:
ABC_HOME=$ABC_ROOT/abc/1.0
TO:
ABC_HOME=$ABC_ROOT/abc/1.5
I'm using this:
perl -pi -e 's\ABC_HOME=$ABC_ROOT/abc/1.0\ABC_HOME=$ABC_ROOT/abc/1.5\g' /apps/scripts/test.sh
This command is not working because... (2 Replies)
Hi i'm new to shell script,
i want to get the filename from specific location which i mentioned in my script.
The scirpt should read the filename exactly using the following command "ls -ltr | tail -1".
Could someone show me on this. Below is my script
#!/bin/ksh
PATH= /usr/
if
then
... (4 Replies)
Hi,
So I struggled to find a solution to the following problem:
I want to make sed print only part of multiple different paths.
So lets say we have
/path/path1/path2/logs/bla/blabla
/path/path1/path2/path3/logs/yadda/yadda/yadda
Can someone suggest a way to make sed or other... (5 Replies)
Discussion started by: dampio
5 Replies
LEARN ABOUT OPENSOLARIS
di_node_private_set
di_node_private_set(3DEVINFO) Device Information Library Functions di_node_private_set(3DEVINFO)NAME
di_node_private_set, di_node_private_get, di_path_private_set, di_path_private_get, di_minor_private_set, di_minor_private_get,
di_link_private_set, di_link_private_get, di_lnode_private_set, di_lnode_private_get - manipulate libdevinfo user traversal pointers
SYNOPSIS
cc [ flag... ] file... -ldevinfo [ library... ]
#include <libdevinfo.h>
void di_node_private_set(di_node_t node, void *data);
void *di_node_private_get(di_node_t node);
void di_path_private_set(di_path_t path, void *data);
void *di_path_private_get(di_path_t path);
void di_minor_private_set(di_minor_t minor, void *data);
void *di_minor_private_get(di_minor_t minor);
void di_link_private_set(di_link_t link, void *data);
void *di_link_private_get(di_link_t link);
void di_lnode_private_set(di_lnode_t lnode, void *data);
void *di_lnode_private_get(di_lnode_t lnode);
PARAMETERS
node The handle to a devinfo node in a di_init(3DEVINFO) snapshot.
path The handle to a path node in a snapshot.
minor The handle to a minor node in a snapshot.
link The handle to a link in a snapshot.
lnode The handle to an lnode in a snapshot.
data A pointer to caller-specific data.
DESCRIPTION
The di_node_private_set() function allows a caller to associate caller-specific data pointed to by data with a devinfo node, thereby facil-
itating traversal of devinfo nodes in the snapshot.
The di_node_private_get() function allows a caller to retrieve a data pointer that was associated with a devinfo node obtained by a call to
di_node_private_set().
The di_path_private_set() function allows a caller to associate caller-specific data pointed to by data with a devinfo path node, thereby
facilitating traversal of path nodes in the snapshot.
The di_path_private_get()function allows a caller to retrieve a data pointer that was associated with a path node obtained by a call to
di_path_private_set().
The di_minor_private_set() function allows a caller to associate caller-specific data pointed to by data with a minor node specified by
minor, thereby facilitating traversal of minor nodes in the snapshot.
The di_minor_private_get() function allows a caller to retrieve a data pointer that was associated with a minor node obtained by a call to
di_minor_private_set().
The di_link_private_set() function allows a caller to associate caller-specific data pointed to by data with a link, thereby facilitating
traversal of links in the snapshot.
The di_link_private_get() function allows a caller to retrieve a data pointer that was associated with a link obtained by a call to
di_link_private_set().
The di_lnode_private_set() function allows a caller to associate caller-specific data pointed to by data with an lnode specified by lnode,
thereby facilitating traversal of lnodes in the snapshot.
The di_lnode_private_get() function allows a caller to retrieve a data pointer that was associated with an lnode by a call to di_lnode_pri-
vate_set().
These functions do not perform any type of locking. It is up to the caller to satisfy any locking needs.
RETURN VALUES
The di_node_private_set(), di_path_private_set(), di_minor_private_set(), di_link_private_set(), and di_lnode_private_set() functions do
not return values.
The di_node_private_get(), di_path_private_get(), di_minor_private_get(), di_link_private_get(), and di_lnode_private_get() functions
return a pointer to caller-specific data that was initialized with their corresponding *_set() function. If no caller-specific data was
assigned with a *_set() function, the results are undefined.
ERRORS
No errors are defined.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
SEE ALSO di_init(3DEVINFO), libdevinfo(3LIB), attributes(5)SunOS 5.11 15 May 2008 di_node_private_set(3DEVINFO)