Hallo
ich moechte die Ausgabe aus folgendem Konstrukt an eine Variable uebergeben:
Die Zeilen geben aus einer MP3 Datei ID3-Tag und andere Daten aus.
Das o.a. Script gibt aus: ID_CLIP_INFO_VALUE1=Fritz_Meier
" ID_CLIP_INFO_VALUE1=Fritz_Meier" soll in die Variable AUTHOR
Dazu bin ich zu DUMM! :-) Finde die passende Syntax nicht mehr
Bitte keine theoretischen Tips, "aka so müsste das laufen" die hab ich alle schon durch. Mit perl kann ich es auch.
Shell (sh, csh, tcsh) sollte es schon sein.
awk statt sed ist auch kein Thema:-)
Der Snipsel stammt aus:/usr/local/share/mplayer/tools/midentify , dem mplayerpacket.
Der Komentar dazu:
---snipp----
# This is a wrapper around the -identify functionality.
# It is supposed to escape the output properly, so it can be easily
# used in shellscripts by 'eval'ing the output of this script.
#
# Written by Tobias Diedrich <ranma+mplayer@tdiedrich.de>
# Licensed under GNU GPL.
---snapp----
Nen Tip? Danke!
Gruss Fred
Ps. Die Standardnummer mit:
variablename=$(sed -n "1p" Datei)
echo $variablename
läuft nicht.
Mit "eval..... sed....." bekomme ich es auch nicht hin.
ich moechte die Ausgabe aus folgendem Konstrukt an eine Variable uebergeben:
Code:
#!/bin/sh
mplayer -vo null -ao null -frames 0 -identify "$@" 2>/dev/null |
sed -ne '/^ID_CLIP_INFO_VALUE1/ {
s/[]()|&;<>`'"'"'\\!$" []/\\&/g;p
}'
Das o.a. Script gibt aus: ID_CLIP_INFO_VALUE1=Fritz_Meier
" ID_CLIP_INFO_VALUE1=Fritz_Meier" soll in die Variable AUTHOR
Dazu bin ich zu DUMM! :-) Finde die passende Syntax nicht mehr
Bitte keine theoretischen Tips, "aka so müsste das laufen" die hab ich alle schon durch. Mit perl kann ich es auch.
Shell (sh, csh, tcsh) sollte es schon sein.
awk statt sed ist auch kein Thema:-)
Der Snipsel stammt aus:/usr/local/share/mplayer/tools/midentify , dem mplayerpacket.
Der Komentar dazu:
---snipp----
# This is a wrapper around the -identify functionality.
# It is supposed to escape the output properly, so it can be easily
# used in shellscripts by 'eval'ing the output of this script.
#
# Written by Tobias Diedrich <ranma+mplayer@tdiedrich.de>
# Licensed under GNU GPL.
---snapp----
Nen Tip? Danke!
Gruss Fred
Ps. Die Standardnummer mit:
variablename=$(sed -n "1p" Datei)
echo $variablename
läuft nicht.
Mit "eval..... sed....." bekomme ich es auch nicht hin.