I need to know how to write data to a file from shell script! Can anyone help me???
DirkFirst Tutorials | Linux Forum
echo "this will overwrite any existing file" > filename
echo "this will append to an existing file" >> filename
Easy enough. Can I read a file by doing the opposite?
echo < filename?
DirkFirst Tutorials | Linux Forum
hey wasup, uhm try this
filename= "fileworld.txt"
print "writing to file: %s" %filename
file= open(filename,'w')
file.write (" Hello file world!")
file.close()
#thats the source code i used and the output is in your notepad, dnt 4get to save the file as a .text file instead of .py
There are currently 4 users browsing this thread. (0 members and 4 guests)
Bookmarks