vendredi 26 décembre 2014

how handle a path ($1)


I've:



/home/wms/mp3/


and



/home/wms/tmp/


Inside ~/tmp my script:



#!/bin/bash
br=64
for a in "$1"*.mp3 ;
do ffmpeg -i "$a" -ar 44100 -ab $br "$br""_tmp/${a%.*} ["$br"].mp3" ; done


I do:



/home/wms/tmp/./script.sh /home/wms/mp3/


How I handle $1?


because "@1" concides with /home/wms/mp3/first1


${a%.*} cuts extension file


but the path is not correct: this script runs only if I runs it inside ~/mp3



Aucun commentaire:

Enregistrer un commentaire