[GELÖST] Stringfunktion unquote

Antworten
Benutzeravatar
tobias
Beiträge: 1294
Registriert: 20 Aug 2008, 12:36
Wohnort: Braunschweig
Kontaktdaten:

[GELÖST] Stringfunktion unquote

Beitrag von tobias »

Hi,

ich verstehe die Funktion unquote beim bearbeiten von Strings irgendwie nicht.

Ich habe in meiner Stringliste z.B. folgenden wert: "WINWORD.EXE"
mit unquote möchte ich die Anführungszeichen entfernen. Nun verstehe ich jedoch die Funktion nicht.

Ich dachte an:

Code: Alles auswählen

set $unquotedprocess$ = unquote($process$) 
oder an

Code: Alles auswählen

set $unquotedprocess$ = unquote(takestring(1,$process$) ) 
Laut Manual wird aber noch <quote-string> benötigt... was will der Winst da haben?


Gruß
Tobias
Zuletzt geändert von tobias am 01 Okt 2012, 14:52, insgesamt 1-mal geändert.
Benutzeravatar
Thomas_H
Beiträge: 525
Registriert: 09 Jun 2010, 11:57
Wohnort: Havelland

Re: Stringfunktion unquote

Beitrag von Thomas_H »

Moinsens,

wenn ich die Anleitung lese verstehe ich das so:

gequoteter Text zum Beispiel: 'word'

Code: Alles auswählen

set $process$ = 'word'
set $unquotedprocess$ = unquote($process$, "'")  # aufgedröselt: " ' "
[code]

gequoteter Text zum Beispiel: "word"

[code]
set $process$ = "word"
set $unquotedprocess$ = unquote($process$, """) # aufgedröselt: " " "
[code]

gequoteter Text zum Beispiel: /word/ # ist ein blödes Beispiel, ich weiss... 

[code]
set $process$ = /word/
set $unquotedprocess$ = unquote($process$, "/") # aufgedröselt: " / "
[code]

oder auch:

gequoteter Text zum Beispiel: "/word/" # ist ein noch blödes Beispiel, ... 

[code]
set $process$ = "/word/"
set $unquotedprocess$ = unquote($process$, ""/") # aufgedröselt: " "/ "
set $unquotedprocess$ = unquote($unquotedprocess$, "/"") # aufgedröselt: " /" "
[code]


Gruß

Thomas_H
Kennst Du schon die WIKI für OPSI-Scripte? Fertige Installationsscripte bekommen und ablegen unter OPSI-Wiki
Aus dem Glashaus :) : UIB bietet auch Schulungen und Supportverträge für Opsi an.
Bild
Benutzeravatar
d.oertel
uib-Team
Beiträge: 3327
Registriert: 04 Jun 2008, 14:27

Re: Stringfunktion unquote

Beitrag von d.oertel »

Hi,

mal in
http://download.uib.de/opsi4.0/testing/ ... tes-de.pdf
nach 'unquote' suchen, da gibt es auch Beispiele.

gruß
d.oertel


Vielen Dank für die Nutzung von opsi. Im Forum ist unser Support begrenzt.

Für den professionellen Einsatz und individuelle Beratung empfehlen wir einen Support-Vertrag und eine Schulung.
Gerne informieren wir Sie zu unserem Angebot.

uib GmbH
Telefon: +49 6131 27561 0
E-Mail: sales@uib.de


Benutzeravatar
tobias
Beiträge: 1294
Registriert: 20 Aug 2008, 12:36
Wohnort: Braunschweig
Kontaktdaten:

Re: Stringfunktion unquote

Beitrag von tobias »

Danke das hat geholfen :)


Gruß
Tobias
Antworten