$ cat $MY_FILE
#
# port for HTTP (descriptions, SOAP, media transfer) traffic
port=8200
# network interfaces to serve, comma delimited
network_interface=eth0
# set this to the directory you want scanned.
# * if have multiple directories, you can have multiple media_dir= lines
# * if you want to restrict a media_dir to a specific content type, you
# can prepend the type, followed by a comma, to the directory:
# + "A" for audio (eg. media_dir=A,/home/jmaggard/Music)
# + "V" for video (eg. media_dir=V,/home/jmaggard/Videos)
# + "P" for images (eg. media_dir=P,/home/jmaggard/Pictures)
#media_dir=V,/srv/media/film
#media_dir=A,/srv/media/musique
#media_dir=P,/srv/media/photo
#media_dir = /home/some_user/my_personal_old_data
# set this if you want to customize the name that shows up on your clients
friendly_name=SJL DLNA Server MY_SERVER OPENSUSE 13.1
Code:
$ sed -e "/$MY_TOKEN/,/^[[:blank:]]*$/{" -e "\|^[[:blank:]]*$|s|.*|${MY_PARAMETER_VALUE}\n&|g" -e "}" $MY_FILE
#
# port for HTTP (descriptions, SOAP, media transfer) traffic
port=8200
# network interfaces to serve, comma delimited
network_interface=eth0
# set this to the directory you want scanned.
# * if have multiple directories, you can have multiple media_dir= lines
# * if you want to restrict a media_dir to a specific content type, you
# can prepend the type, followed by a comma, to the directory:
# + "A" for audio (eg. media_dir=A,/home/jmaggard/Music)
# + "V" for video (eg. media_dir=V,/home/jmaggard/Videos)
# + "P" for images (eg. media_dir=P,/home/jmaggard/Pictures)
#media_dir=V,/srv/media/film
#media_dir=A,/srv/media/musique
#media_dir=P,/srv/media/photo
#media_dir = /home/some_user/my_personal_old_data
media_dir = /srv/media/my_personal_new_data
# set this if you want to customize the name that shows up on your clients
friendly_name=SJL DLNA Server MY_SERVER OPENSUSE 13.1
Last line of file must a blank line.
To modified directly the file, you can use -i option if your sed support.
You just create a function that call this type de sed command.
Regards.
This User Gave Thanks to disedorgue For This Post:
Hello everyone... please help if you can -- I'm stumped. Making this work will save me hours of manual labor:
I need to search file2 for pattern in file1. If pattern found append file2 line to file3. If pattern not found append a blank line to file3.
file1 contents example:
123
456
789... (6 Replies)
I need your help,
I want to add a text every 2nd line and also a blank line after 3 line
(In the output 2nd line is "changetype: modify" and every 4th line is blank line)
Input file format
dn: abc
orclsourceobjectdn: abcd
dn: bcd
orclsourceobjectdn: bcda
dn: cba
orclsourceobjectdn:... (7 Replies)
Hi,
I want to write a sed script which from
batiato:
batiato/giubbe:
pip_b.2.txt
pip_b.3.txt
pip_b.3mmm.txt
bennato:
bennato/peterpan:
123.txt
consoli:
pip_a.12.txt
daniele: (2 Replies)
i need to compare three files in unix
a.txt b.txt c.txt
1 2 1
2 5 3
4 6 5
5 6
6
i need to insert a blank line in the file if i don't find a match
and put the items at the same column if found a match
The items in the files... (4 Replies)
Hi all,
I've googling around forum regarding my prob, the nearest would same as thread tittled Insert blank line if grep not found, but she/he did not mention the solution, so I would like to request your help
I've this task, to search in file2 based on pattern in file1 and output it to... (4 Replies)
Hello,
I am trying to write a script that will count the number of characters for each line in a file and all the lines that have less than 80 characters and that are ending with a period, I want it to insert a blank line after them immediately. But, for whatever reason the condition if ]] is... (3 Replies)
Hi,
I have a file with no blank line anywhere
Its a conf file, The lines between and starts with "#" should be sort out with the first three characters(characters are between (a-z)). and insert a blank space in between the uniq lines. For clear understanding ,pls find the below input file... (11 Replies)
Hello,
I have a file that I want to be able to insert a new line before every instance of a regex. I can get it to do this for each line that contains the regex, but not for each instance.
Contents of infile:
Test this 1...
Test this 2...
Test this 3... Test this 4... Test this... (2 Replies)
Hello.
The token is any printable characters between 2 " .
The token is unknown, but we know that it is between 2 "
Tok 1 : "1234x567"
Tok 2 : "A3b6+None"
Tok 3 : "A3b6!1234=@"
The ligne is :
Line 1 :
"9876xABCDE"Do you have any code fragments or data samples in your post
Line 2 : ... (3 Replies)
Discussion started by: jcdole
3 Replies
LEARN ABOUT DEBIAN
dr_symlinks
dr_symlinks(1) USER COMMANDS dr_symlinks(1)
NAME
dr_symlinks - maintain a symlink forest
SYNOPSIS
dr_symlinks
DESCRIPTION
For each pair directory/subdirectory under each word in DR_SL_TARGETS, a directory and symlink DR_SL_SOURCE/directory/symlink is created (or
adjusted). The script is implemented as a wrapper around oggsymlinks, by Wessel Dankers.
EXAMPLE
If, in the configuration file $HOME/.draai/symlinksrc, DR_SL_SOURCE is set to /srv/audio and DR_SL_TARGETS is set to "../data/a ../data/b",
while directories
/srv/data/a/And_You_Will_Know_Us_By_the_Trail_of_Dead/Source_Tags_And_Codes/
/srv/data/a/And_You_Will_Know_Us_By_the_Trail_of_Dead/The_Century_of_Self/
/srv/data/a/John_Coltrane/A_Love_Supreme/
/srv/data/b/John_Coltrane/Giant_Steps/
/srv/data/b/Tinariwen/Amassakoul/
exist, the following directories holding the following symlinks will get created in /srv/audio/ :
And_You_Will_Know_Us_By_the_Trail_of_Dead/Source_Tags_And_Codes ->
../../../a/And_You_Will_Know_Us_By_the_Trail_of_Dead/Source_Tags_And_Codes/
And_You_Will_Know_Us_By_the_Trail_of_Dead/The_Century_of_Self ->
../../../a/And_You_Will_Know_Us_By_the_Trail_of_Dead/The_Century_of_Self/
John_Coltrane/A_Love_Supreme -> ../../../a/John_Coltrane/A_Love_Supreme/
John_Coltrane/Giant_Steps -> ../../../b/John_Coltrane/Giant_Steps/
Tinariwen/Amassakoul -> ../../../b/Tinariwen/Amassakoul/
All dangling symlinks and empty directories (if any) under /srv/audio/ will get removed. This script is idempotent.
ANOTHER EXAMPLE
joostvb@hille:~% ls media/usb/audio/200504/Al_Green
The_Very_Best_Of/
joostvb@hille:~% ls media/usb/audio/
200504/ 200708/ 200801/ 200805/ 200807/ 200812/ 200910/ 201005/ 201009/
200609/ 200712/ 200803/ 200806/ 200808/ 200905/ 201004/ 201006/
joostvb@hille:~% cat .draai/symlinksrc.usb
DR_SL_SOURCE=~/media/audio
DR_SL_TARGETS="$( cd $DR_SL_SOURCE && ls -d ../usb/audio/* )"
joostvb@hille:~% DR_SL_RCFILE=.draai/symlinksrc.usb dr_symlinks
joostvb@hille:~% ls -l media/audio/Al_Green
total 0
lrwxrwxrwx 1 joostvb joostvb 48 2011-03-11 09:12 The_Very_Best_Of -> ../../usb/audio/200504/Al_Green/The_Very_Best_Of/
ENVIRONMENT
dr_symlinks honors booleans: DR_SL_VERBOSE, DR_DEBUG and DR_DRYRUN and strings: DR_SL_RCFILE, DR_SL_TARGETS and DR_SL_SOURCE.
FILES, CONFIGURATION
All configuration variables (see ENVIRONMENT) can be set in ~/.draai/symlinksrc. This rc-file is sourced as a shell script. If DR_SL_RCFILE
is set, its value is assumed to be the dr_symlinks rc-file.
COPYRIGHT AND LICENSE
This manpage is copyright 2009, 2011 Joost van Baal <joostvb-draai@mdcc.cx>.
Draai is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, as published by the Free
Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed WITHOUT ANY WAR-
RANTY. You should have received a copy of the GNU General Public License along with draai. If not, see http://www.gnu.org/licenses/.
AUTHOR
Joost van Baal <joostvb-draai@mdcc.cx>
dr_symlinks 20110603 03 juin 2011 dr_symlinks(1)