Need help with scripting
Hi all
If someone can help me with my problem I will bi very happy I need to write a script witch increases a number in a file ig. when i run it first will bi sn:1 when i run it the second time sn:2 an so on If you can help me I will bi very very happy ! Thanks |
script
just save the following with some file name, give it execute permissions and it will do the job for u..
######################## #!/bin/sh if [ -a /tmp/hello ] then b=`cat /tmp/hello | cut -f2 -d:` b=`expr $b + 1` echo sn:$b > /tmp/hello else a=1 echo sn:$a > /tmp/hello fi ######################## /tmp/hello is the file where u need the the "sn:1", "sn:2" to be there. happy scripting.. aaditya |
All times are GMT -5. The time now is 05:52 PM. |