This is my bash script.#!/bin/bashoo=`cat /etc/httpd/conf/httpd.conf`;cat > /a.txt << EOF$ooEOFit simply reads /etc/httpd/conf/httpd.conf and writes it to /a.txt, the problem has been when this is executed via web scripts with sudo command.. for some reason not everything is written to the a.txt filebut when executed via command line.. everything is written just fine to a.txtso perhaps i should send this to a background process by adding:> /dev/null 2>&1to it. but how can this be done? i tried#!/bin/bashoo=`cat /etc/httpd/conf/httpd.conf`;cat > /a.txt << EOF$ooEOF > /dev/null 2>&1this did not work.
How to fork a cat command?
bash;cat;fork
Maybe this example is just extremely oversimplified, but I'm having trouble seeing why you wouldn't just run:cp /etc/httpd/conf/httpd.conf /a.txtThat is, there's already a command that simply reads from one file and creates another with its contents, and it's called cp.  The only real difference would be if /a.txt already existed and you were trying to retain its permissions, or some such - but even then, you'd want to just do:cat /etc/httpd/conf/httpd.conf >/a.txt