mit Sed Text aus Datei nur nach dem ersten Treffer einfügen
Hello,
I'm new in Shell scripting but i should write a script, which inserts the license header out of a txt-File into the files in our Projekt. For the Java classes it runs without Problems but for XML files not. At xml-files i have to put the license Header after the xml-Header (?xml version="1.0" ... ?) but the xml Header is not only one line all the time, it could be about 2 or 3 lines.
first i tried with this.
This is searching for the expression "?>" an insert the license Header after this expression and it also runs.
But if this Expression is in the file one more time, f.e. in another xml-header whis is in a comment, the shouldn't be insert again.
so i try to find a way, that only the first match was taken to consideration and hope that somebody can help me
thanks and sry for my verry bad english
Last edited by PhoenixONE; 02-05-2010 at 06:37 AM..
Is anyone actively learning, auditing or participating (for credit) at edX?
There are some really great science and engineering programs there and they are all free to audit. For example, take a look at these classes related to:
C Programming
Quantum Physics
Computer Science
... (6 Replies)
Hallo,
ich habe mir mit meinen dürftigen Programmierkenntnissen ein Script zusammengebastelt über das ich in einem bestimmten Odner mit AWK alle Dateien eines Verzeichnis durchsuche und bestimmte Bezeichungen aller Dateien ändern kann.
Es funktioniert auch soweit, nur hätte ich gerne auch die... (1 Reply)
Hiho.
Ich habe mit meinen rudimentären Scriptkenntnissen folgendes nicht sehr elegantes Script geschrieben und würde es gern in einer etwas eleganteren Form haben.
i=0 ... (2 Replies)
Hiho.
Ich habe mit meinen rudimentären Scriptkenntnissen folgendes nicht sehr elegantes Script geschrieben und würde es gern in einer etwas eleganteren Form haben.
i=0 ... (2 Replies)
salve!
this in windows command script (batch).
i need it for mac....unix or linux
@echo off
Echo Router reconnect: AVM FRITZ!BOX FON WLAN 7170
curl "http://192.168.10.10:49000/upnp/control/WANIPConn1" -H "Content-Type: text/xml; charset="utf-8"" -H... (1 Reply)
Hallo,
ich habe eine Datei "Kino.ini" die z.B. wie folgt aussieht
* KINOFILM A
bla bla
KINOFILM B
blubb blubb
KINOFILM C
Ich möchte nun die Datei "Kino.ini" per cat und grep auslesen und testen ob der String KINOFILM nur mit einem '*' am Anfang vorkommt. In dieser Beispieldatei... (3 Replies)
Anyone:
I have a very annoying problem on one of our servers (running Solaris 8). when ever I try to run "xhost +" with the display set at "localhost:0.0" I get the following error:
xhost +
Xlib: connection to "finappprod:0.0" refused by server
Xlib: Invalid... (1 Reply)