Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

bash problem

Name: Anonymous 2009-03-08 19:58

/txt/ fags,

i have the following piece of code:

sudo -u bittorrent screen -d -m bittorrent-curses $torrentdir/$t &

im trying to redirect the output of the "bittorrent-curses" command, but im doing it wrong, im doing something like this:

sudo -u bittorrent screen -d -m bittorrent-curses $torrentdir/$t > /foo/bar.log &

but the log file is created as root, i think is saving the output of the sudo command, some quote problem maybe?

Name: Anonymous 2009-03-09 13:14

>>1
The redirect happens before the sudo, so bash tries to open the log file as the user running bash. Use this instead:
sudo -u bittorrent sh -c 'screen -d -m bittorrent-curses $torrentdir/$t > /foo/bar.log' &

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List