Forum: Shell Scripting May 23rd, 2009 |
| Replies: 5 Views: 847 use awk
awk '/default = ALL/{
print "default = DES-168"
print "default = RC2-128"
print "default = RC4-128"
print "#"$0
next}1' file |
Forum: Shell Scripting Aug 19th, 2008 |
| Replies: 2 Views: 1,032 better still, no need grep
top | awk '/root/{ sum += $10 }END {print sum}' |
Forum: Python May 31st, 2007 |
| Replies: 3 Views: 2,307 one method i always use is the os.path.join() method.
dir = os.path.join("C:\\","documents and settings","user","desktop")
starcraftpath = os.path.join(dir,"starcraft.exe")
takes care of the... |
Forum: Python Apr 17th, 2007 |
| Replies: 5 Views: 1,047 if in the file, the content is indeed this:
[1,2,3,4]
then when you read the file line by line, you can use eval() to turn it into a list
for line in open("file"):
alist = eval(line)
... |
Forum: Windows NT / 2000 / XP Jan 27th, 2007 |
| Replies: 22 Views: 3,529 I did not change the syntax. Its how variables are defined in Windows batch shell.
If you open a command prompt and work your batch commands from there using for loops, you have to use %i (or some... |