将shellscript代码转换为c

将shellscript代码转换为c,c,shell,C,Shell,嘿,c大师。。我正在尝试将下面的shell脚本代码转换为c。请帮我用c重新编码。提前谢谢 #count1: #! /bin/sh # count1 appends an increment to a file 100 times # note that a file called numbers must be initialised to contain 0 count=0 while [ $count -lt 100 ] # loop 100 times do coun

嘿,c大师。。我正在尝试将下面的shell脚本代码转换为c。请帮我用c重新编码。提前谢谢

#count1:
#! /bin/sh
# count1 appends an increment to a file 100 times

# note that a file called numbers must be initialised to contain 0

count=0

while [ $count -lt 100 ]    # loop 100 times

do

   count=`expr $count + 1`  # increment counter

   n=`tail -1 numbers`      # get last line from numbers file

   expr $n + 1 >> numbers   # add 1 to it and append it back

done

我并不是真的在这里回答,但话说回来,你并不是真的在问问题,所以让我们都放松一下邮政政策:)

你想要的C代码相当简单:你可以用你在任何一本C书的前几章学到的东西来编写它。你不能的事实可能意味着你几乎不知道或者根本不知道C,所以即使我为你做了,你也不会明白我给了你什么

为什么这么重要?好吧,在Stack Overflow中,我们很乐意以想法、诀窍和技术细节的形式提供编程帮助,但我们不会做其他人的工作。如果你不明白我们给你的是什么,那么我们不是在帮你编码,而是在替你编码


如果你喜欢,我可以向你推荐书籍或教程

你要我们为你写代码?那就少了“协助”,多了“做”,不是吗?