Created
December 9, 2014 20:53
-
-
Save marek-pietrzak-tg/15e2ae44c4e95e0e2906 to your computer and use it in GitHub Desktop.
Runs PhantomJs in background
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Running PhantomJs..." | |
LOGFILE=/tmp/phantomjs.log | |
exec 6>&1 # Link file descriptor #6 with stdout. | |
exec > $LOGFILE # stdout replaced with file "logfile.txt". | |
# ----------------------------------------------------------- # | |
# All output from commands in this block sent to file $LOGFILE. | |
/usr/local/bin/phantomjs --webdriver=4444 & | |
# ----------------------------------------------------------- # | |
exec 1>&6 6>&- # Restore stdout and close file descriptor #6. | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
U can use: