Jump to content




Recent Status Updates

  • Photo
      18 Aug
    KodeKool

    When faced with a wall of errors and no hope to fix them, remember the following "Programs always do what you tell them to, and seldom what you want them to, but eventually you'll run out of things that can go wrong and it'll just work. and that's the secret to good programming."

    Show comments (2)
  • Photo
      11 Aug
    Error

    Should I be practicing programming every day? I feel if I don't, I'll get instantly rusty or something.

    Show comments (4)
View All Updates

Developed by Kemal Taskin
Photo
- - - - -

read file with if argument.....


  • Please log in to reply
7 replies to this topic

#1 kiddies

kiddies

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 129 posts

Posted 31 July 2009 - 06:16 AM

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

#2 WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderator
  • 16,988 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 31 July 2009 - 07:33 AM

Can you give an example of what you're talking about?
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#3 kiddies

kiddies

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 129 posts

Posted 01 August 2009 - 01:36 AM

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...
  • 0

#4 WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderator
  • 16,988 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 01 August 2009 - 04:20 AM

You'll need some kind of loop... I'm still not clear on what you're trying to accomplish.
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#5 kiddies

kiddies

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 129 posts

Posted 02 August 2009 - 06:33 AM

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

#6 WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderator
  • 16,988 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 02 August 2009 - 07:15 AM

What are you trying to do?
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#7 kiddies

kiddies

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 129 posts

Posted 04 August 2009 - 06:24 AM

just wanna learn n make it work well...
  • 0

#8 WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderator
  • 16,988 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 04 August 2009 - 06:33 AM

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.
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/