Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

304
Views
apache on raspberry pi calling a bash script using system() won't write a file

so I have a cgi program in C that calls these lines:

            system("./temp.cgi >temp.lis");
            system("ls >dir.lis");
            system("echo \"hello there you \" > ht.lis");
            system("ps -A >ps.lis");

all four lines execute, and create the corresponding .lis files, but temp.lis is empty, it is 0 bytes long. here is the code for temp.cgi:

#!/bin/bash
/opt/vc/bin/vcgencmd measure_temp >temp2.lis
exit

the generated file temp2.lis is also generated, but it is also 0 bytes long.

How can I get temp.cgi to run and generate an output file?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!