LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   (mc, samba, mplayer) delete 2 first chars in an argument (https://www.linuxquestions.org/questions/linux-newbie-8/mc-samba-mplayer-delete-2-first-chars-in-an-argument-166031/)

Xa! 04-04-2004 07:47 AM

(mc, samba, mplayer) delete 2 first chars in an argument
 
Hi!


in .mc/bindings i write

------------------------------------------------------
include/video
open=(mplayer %d/%p >/dev/null 2>&1 &)
------------------------------------------------------
and it works fine untill i want to watch a film from unmounted samba because "%d/%f" returns something like "/#smb://computer-pc/video/file.avi", but mplayer needs "smb://computer-pc/video/film.avi".

So what must i write in .mc/bindings to return proper file-path, i.e. delete "/#" in a path returned by "%d/%p"

iluvatar 04-28-2004 02:45 AM

you may want to try this:

-----------------------------------------------------
include/video
open=(mplayer $(echo %d/%p | sed s/"#\/"//) >/dev/null 2>&1 &;)
-----------------------------------------------------

this will remove the first '#/' if it's there...

greetz,
.-=~ iluvatar ~=-.


All times are GMT -5. The time now is 04:24 PM.