I have a text file which is output from a server and it lists all the files in a specific volume. However, the volume name appears as volume_name:.
I would like to replace this with \\volume_name\volume_name. This is not a problem in itself as I can use sed to globally look for the volume_name: pattern in the text file and replace it with the correct string.
However, since there are many volume names in different text files and the process to replace them is exactly the same, I was thinking of a more generic solution.
So at the moment the format goes like this:
Is it possible to use sed to analyse the characters from between ^ and \ and then replace them with \\volume_name\volume_name minus the colon. The ^ sign is the delimiter in this file.
Hi Friends,
Following is an output of a script
OPWQERIUTYKLSADFJHGXZNMCVBWQOPERIUTYKLSADFJHGXZNMCVB
I want to replace above string's 11 to 17 character by ******* (7 stars)
How can it be done?
Please somebody guide me. (6 Replies)
Hello,
I have a file with many lines with below format:
\abc\\1234
jkl\\567
def\\345
\pqr\\567
\xyz\\234
Here, i need to do 2 things.
1. replace \\ with \
2. remove starting \
so output to be as below: (11 Replies)
I tried to replace the following in vi:
old: 'e/thesis/pp/zones/zones'
new: 'd/so162/fix/pp'
For that, I used: :%s/e/thesis/pp/zones/zones/d/so162/fix/pp/g
but doesn't work, a trailing character error message appeared. How can I get it?
Thanks in advance (3 Replies)
Hi, I have a bash script and I am looking for a command that will merge specific lines together.
Sample Data:
registration time = 1300890272
Id = 1
setd = 0
tagunt = 26
tagId=6, length=8, value=
tagId=9, length=5, value=
tagId=7, length=2, value=
tagId=16, length=2, value=
tagId=32,... (8 Replies)
Hi,
I'm attempting to rename some files that have spaces in them. Without linking sed commands together is it possible to replace the first three "." to " ".
File.name.is.long.ext -> File name is long.ext
I can get the desired effect with
echo "File.name.is.long.ext" | sed 's/\./ /g;s/... (5 Replies)
Hi,
I have a input of the form:
..., word1, word2, word3...
I want out put of the form
word1, word2, word3
I tried echo '..., word1, word2, word3...' | tr -d '...,'
but that takes out the commas in the middle too so I get
word1 word2 word3
but I want the commas in the middle.
... (3 Replies)
sed -e "s// /g" old.txt > new.txt
While I do know some control characters need to be escaped, can normal characters also be escaped and still work the same way? Basically I do not know all control characters that have a special meaning, for example, ?, ., % have a meaning and have to be escaped... (11 Replies)
Hi,
I have a text file with some lines like this:
/MEDIA/DISK1/23568742.MOV
/MEDIA/DISK1/87456321.AVI
/MEDIA/DISK2/PART1/45753131.AVI
/IMPORT/44452.WAV
...
I want to remove the last 12 characters in each line that it ends "AVI". Should look like this:
/MEDIA/DISK1/23568742.MOV... (12 Replies)
Hi guys, I'm new to bash programming, so please pardon me.
I'm trying to replace an entry's text in Books.txt
This code works perfectly:
sed -i "s/$BookTitle/$NewBookTitle/g" Books.txt
But problem is, if there are double entries, it will also replace that entry. For example:
... (12 Replies)
Hi,
Im using sed on an AIX machine. I am trying to change the 137-139 characters if they are a ' 36'/'000' to a '036'. The positions that need to be changed are fixed.
the source data that I have is$cat v.txt
4000422985400050462239065593606500000007422985707771046154054910075641MC0318AMWAY... (9 Replies)
Discussion started by: dsid
9 Replies
LEARN ABOUT MOJAVE
mount_webdav
MOUNT_WEBDAV(8) BSD System Manager's Manual MOUNT_WEBDAV(8)NAME
mount_webdav -- mount a WebDAV filesystem
SYNOPSIS
mount_webdav [-s] [-S] [-i] [-v volume_name] [-o options] [scheme://]host[:port][/path] node
DESCRIPTION
The mount_webdav command mounts the WebDAV-enabled server directory at [scheme://]host[:port][/path] at the mount point indicated by node.
The user and group IDs for all files and directories are set to unknown, and the permissions default to read, write and execute for user,
group and other.
The arguments and options are:
-s Require that authentication credentials be sent securely to the server. Note: If this option is not set, sending authentication cre-
dentials insecurely to the server will be allowed but will be logged.
-S Suppresses all user interface including the authentication dialogs and the non-responsive ("disconnect") server dialogs. If the
server connection becomes non-responsive, the file system is immediately unmounted when this option has been used.
-i Interactive mode, you are prompted for the username and password.
-o Options passed to mount(2) are specified with the -o option followed by a comma-separated string of options. See the mount(8) man
page for possible options and their meanings. If connecting to a Class 1 compliant WebDAV server, the rdonly option will be set even
if it was not specified because mount_webdav will not allow files to be opened with write access on servers which do not support the
DAV LOCK method.
-v volume_name
Allows the volume_name attribute (ATTR_VOL_NAME) returned by getattrlist(2) to be specified. If the volume_name is not specified, the
last path component name of the node path is used as the volume_name.
[scheme://]host[:port][/path]
The WebDAV-enabled server directory (collection resource) to mount as a volume. The scheme, if specified, must be "http://" or
"https://". If the scheme is not specified, then "http://" is used. If the port is not specified, then port 80 is used when the
scheme is "http://" or port 443 is used when the scheme is "https://". If the path is not specified, then the path "/" is used.
node Path to mount point. Note: The mount point directory must be created or exist before issuing the mount_webdav command.
EXAMPLES
The following example illustrates how to mount the WebDAV-enabled server directory http://idisk.mac.com/membername/ at the mount point
/Volumes/mntpnt/. Note: The mountpoint directory /Volumes/mntpnt/ must be created before issuing the mount_webdav command.
mount_webdav http://idisk.mac.com/membername/ /Volumes/mntpnt/
DIAGNOSTICS
The mount_webdav utility exits 0 on success, and >0 if an error occurs. Here is a list of common results (other error results not listed may
be returned):
0 mount_webdav successfully mounted the server directory.
[ENOENT] The server directory could not be mounted by mount_webdav because the node path is invalid.
[ENODEV] The server directory could not be mounted by mount_webdav because it is not WebDAV-enabled or because it does not exist,
or because node does not have proper access.
[ECANCELED] The server directory could not be mounted by mount_webdav because the user did not provide proper authentication creden-
tials.
COMPATIBILITY
As noted above, the -afd option is considered deprecated in Mac OS X 10.4 and may not be supported in future releases. Use the FSMountServer-
VolumeSync() and FSMountServerVolumeAsync() APIs in CarbonCore/Files.h instead.
SEE ALSO mount(2), unmount(2), mount(8)getattrlist(2)HISTORY
The mount_webdav command first appeared Mac OS X Version 10.0. Support for HTTP Digest Access authentication was added in Mac OS X Version
10.1.1. Support for the https URL scheme, and for additional authentication methods and proxies supported by the CFNetwork framework were
added in Mac OS X Version 10.4.
Mac OS X October 27, 2008 Mac OS X