Cela risque de posé problème, bash va interpréter les $app comme une variable :
$ echo "$app["bs.login"]"
[bs.login]
Il faut utilisé des simples quote dans ce cas, et devrais pas avoir de soucis :
echo '<?php
/*
General configuration of Cakebox
*/
$app["cakebox.root"] = "/home/'$USER'/torrents/"; // Root directory Cakebox have to scan
$app["cakebox.access"] = "/cakebox/'$USER'/"; // Alias used in web server for direct access
$app["cakebox.language"] = "fr"; //Language of Cakebox. Could be : fr, en
/*
Directory settings
*/
$app["directory.ignoreDotFiles"] = false;
$app["directory.ignore"] = "//"; // Regex for files exclusion. For exemple : "/(\.nfo|\.test)$/"
/*
Web player settings
*/
$app["player.default_type"] = "html5"; // html5 or divx or vlc
$app["player.auto_play"] = "false";
/*
Betaseries account
NB: Ask API key here [url]http://www.betaseries.com/api/[/url]
*/
$app["bs.login"] = "";
$app["bs.passwd"] = "";
$app["bs.apikey"] = "";
$app["rights.canPlayMedia"] = true;
$app["rights.canDownloadFile"] = true;
$app["rights.canArchiveDirectory"] = true;
$app["rights.canDelete"] = true;' > /var/www/cakebox/config/$USER.php