So I’m writing a script to generate a list of random passwords. Once the list is generated they are output to a .txt file. They are in a very simple list like so:
What I need to happen is for a separate script to read this file, grab the first line and push the password to active directory. Once it’s read the password and its all set it should delete what it read from the text file. So then it should read as such:
So this raises a few questions. First of all can I read and delete the line to begin with. Secondly if I delete that line, will it leave empty space? Third, If it leaves empty space can that space be deleted so that the second line then becomes the first line? and what commands/code would be used to accomplish this?
Any insight to this would be incredibly helpful. Note: This isn’t anything major and I don’t expect anyone to jump on it immediately as I have plenty of time to do this.