Search Results

Showing results 1 to 5 of 5
Search took 0.01 seconds.
Search: Posts Made By: ghostdog74
Forum: Shell Scripting May 23rd, 2009
Replies: 5
Views: 847
Posted By ghostdog74
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
Posted By ghostdog74
better still, no need grep

top | awk '/root/{ sum += $10 }END {print sum}'
Forum: Python May 31st, 2007
Replies: 3
Views: 2,307
Posted By ghostdog74
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
Posted By ghostdog74
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
Posted By ghostdog74
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...
Showing results 1 to 5 of 5

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC