You are not logged in.

#1 2005-03-27 20:37:23

matto
Member
From: Münster/germany
Registered: 2004-06-03
Posts: 88
Website

scripting, basic problems

hi!
i am writing a batch script and would like to know if you can do the following:
in my script i want to use: mp3info -p %a $1 ,  this prints the "artist" of a given file to the terminal. but i want to store this in a string! i tried " > yeah[0]" but without success ;-) how do i do that??
in mind i want something like that:

yeah[0]= mp3info -p %a $1
echo -----
echo name:
echo ${yeah[0]}
echo -----

greetings matto


// DAMNiAM //

Offline

#2 2005-03-27 21:11:22

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: scripting, basic problems

bla=`echo bla`

See http://www.tldp.org/LDP/abs/html/ for more info.

Offline

#3 2005-03-27 21:11:47

smith
Member
From: Crescent City, CA
Registered: 2005-02-19
Posts: 77

Re: scripting, basic problems

My bash knowledge is a bit rusty but this might work:

artist=`mp3info -p %a $1`
echo $artist

I have nothing to say, and I am saying it.

Offline

#4 2005-03-28 15:40:17

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: scripting, basic problems

This is newbie corner, so the original poster probably won't notice tha those are back tics, and not apostrophes around the command. IE: the thingy under the tilde (~) key in the upper left corner.

A more nestable syntax that is recommended by modern bash is:

artist=$(mp3info -p %a $1)

Dusty

Offline

Board footer

Powered by FluxBB