+ Reply to Thread
Results 1 to 8 of 8

Thread: read file with if argument.....

  1. #1
    kiddies is offline Programmer
    Join Date
    May 2009
    Posts
    129
    Rep Power
    0

    read file with if argument.....

    hey master, i wanna ask about read file with if argument, couse i always get script for read file with while argumrnt...

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2006
    Posts
    16,478
    Blog Entries
    75
    Rep Power
    143

    Re: read file with if argument.....

    Can you give an example of what you're talking about?
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  4. #3
    kiddies is offline Programmer
    Join Date
    May 2009
    Posts
    129
    Rep Power
    0

    Re: read file with if argument.....

    value=0;

    while read line
    do
    value=`expr $value + 1`;
    echo $value;
    done < "myfile"

    echo $value;
    i will make this with if argument...can u change it...

  5. #4
    Join Date
    Jul 2006
    Posts
    16,478
    Blog Entries
    75
    Rep Power
    143

    Re: read file with if argument.....

    You'll need some kind of loop... I'm still not clear on what you're trying to accomplish.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  6. #5
    kiddies is offline Programmer
    Join Date
    May 2009
    Posts
    129
    Rep Power
    0

    Re: read file with if argument.....

    ok, i cannot understand in shell script sir...

  7. #6
    Join Date
    Jul 2006
    Posts
    16,478
    Blog Entries
    75
    Rep Power
    143

    Re: read file with if argument.....

    What are you trying to do?
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  8. #7
    kiddies is offline Programmer
    Join Date
    May 2009
    Posts
    129
    Rep Power
    0

    Re: read file with if argument.....

    just wanna learn n make it work well...

  9. #8
    Join Date
    Jul 2006
    Posts
    16,478
    Blog Entries
    75
    Rep Power
    143

    Re: read file with if argument.....

    When writing software, the first step is to think in terms of "What are my inputs, what are my outputs?" You then write processing to get from your inputs to your outputs.

    What you have given is the processing, but neither the inputs nor the desired outputs. Based on that, I cannot help you because I don't know the purpose of the code you wrote, what it's supposed to do, or why it is inadequate.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Read from a file
    By vasil_9x in forum C and C++
    Replies: 4
    Last Post: 04-05-2011, 09:11 AM
  2. c++ file read
    By sh4 in forum C and C++
    Replies: 3
    Last Post: 01-10-2011, 02:32 AM
  3. How can we know whether a file is read or not
    By swathin2 in forum C and C++
    Replies: 6
    Last Post: 09-08-2009, 09:37 PM
  4. trying to read from a file?
    By hallinan in forum C and C++
    Replies: 1
    Last Post: 02-12-2008, 06:51 PM
  5. Replies: 1
    Last Post: 01-01-2008, 02:27 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts