LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-02-2005, 09:55 AM   #1
carl0ski
Member
 
Registered: Sep 2004
Location: Melbourne, Victoria Australia
Distribution: Support those that support you :)
Posts: 872
Blog Entries: 12

Rep: Reputation: 30
manipulate dcop data for File commandS?


Hi
i'm trying to grab the data from this dcop command and manipulate it in the command line
make symlinks, copy move the files etc

Quote:
dcop amarok player path
is the command to view the Path of current song
Quote:
/mnt/music/Artist/Album/Track01.ogg
but i can't figure how i can use this data in a script

i've tried
cp "dcop amarok player path" /home/carl0ski/


/mnt/music/Artist/Album/Track01.ogg > %song
cp %song /home/carl0ski/



#!/bin/bash
ln -s $1 /home/carl0ski/Desktop/music/

sh ./copysongscript.sh %song




but all create a text file called %song with the file name contained, not a physical copy of the file .

thanks
 
Old 07-02-2005, 11:49 AM   #2
carl.waldbieser
Member
 
Registered: Jun 2005
Location: Pennsylvania
Distribution: Kubuntu
Posts: 197

Rep: Reputation: 32
I am not *exactly* sure what you are trying to do, but it looks like you want to have a script that when you run it copies the current playing song to your home directory?

The version of amarok I am using does not support the "dcop amarok player path" command, but assuming that works fine for your version, the following bash script should work-- I obviously cannot test it for bugs, though:

Code:
#!/bin/bash

##################################
# Copies currently playing amarok song to my home
# directory.
##################################

cp "$(dcop amarok player path)" ~
 
Old 07-02-2005, 08:46 PM   #3
carl0ski
Member
 
Registered: Sep 2004
Location: Melbourne, Victoria Australia
Distribution: Support those that support you :)
Posts: 872

Original Poster
Blog Entries: 12

Rep: Reputation: 30
Quote:
Originally posted by carl.waldbieser
I am not *exactly* sure what you are trying to do, but it looks like you want to have a script that when you run it copies the current playing song to your home directory?

The version of amarok I am using does not support the "dcop amarok player path" command, but assuming that works fine for your version, the following bash script should work-- I obviously cannot test it for bugs, though:

Code:
#!/bin/bash

##################################
# Copies currently playing amarok song to my home
# directory.
##################################

cp "$(dcop amarok player path)" ~
i mainly wanted to easily rename certain songs, maybe fixiup permission errors on some that prevent tags being written
because once i figure out how to do this i can figure out how to rename files to suit the tag eventually

thank you.

example

cp "$(dcop amarok player path)" ~/Desktop/music/"$(dcop amarok player artist)"\ -\ "$(dcop amarok player title)".mp3

Last edited by carl0ski; 07-02-2005 at 08:52 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
manipulate the floppy bruse Mandriva 1 02-22-2005 07:49 AM
how to manipulate string in script? ringerxyz Programming 2 02-17-2005 01:14 AM
Manipulate .ISO files in Linux????? Garrett_80 Linux - Software 3 12-15-2004 09:53 AM
What's the purpose of tar.gz files and how do I manipulate them? altair401 Linux - Newbie 7 12-21-2003 07:41 PM
need to manipulate dates clsonnt Programming 5 08-19-2003 10:07 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration