Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Please help me with this simple C question

Please help me with this simple C question

Scheduled Pinned Locked Moved C#
questionperllinuxhelptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    meixiang6
    wrote on last edited by
    #1

    Please please help with this simple Q from a C newbie....I spent hours trying to find the answer online... I want to run this on a linux box. Open a file containing a list of file names and then run a linux commands on each of the list for example: The file contains a list of files names eg: test test1 test2 test3 How do I code in C so that it opens the file and then foreach of the elements do a system command eg: ls in perl it would be something like: #!/usr/local/bin/perl while(<>){ chomp; $cmd="ls $_"; system($cmd); print "$cmd\n"; } Thanks in advance!

    L 1 Reply Last reply
    0
    • M meixiang6

      Please please help with this simple Q from a C newbie....I spent hours trying to find the answer online... I want to run this on a linux box. Open a file containing a list of file names and then run a linux commands on each of the list for example: The file contains a list of files names eg: test test1 test2 test3 How do I code in C so that it opens the file and then foreach of the elements do a system command eg: ls in perl it would be something like: #!/usr/local/bin/perl while(<>){ chomp; $cmd="ls $_"; system($cmd); print "$cmd\n"; } Thanks in advance!

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, this is the C# forum, C# is one of the .NET languages. For plain old C you should post on the C++/MFC forum. :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


      modified on Thursday, February 19, 2009 5:47 PM

      modified on Sunday, June 12, 2011 8:23 AM

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups