1

1.KaliLinux make a 20 word .txt file on (NANO or VIM) 2. Make the script bash on your Kali used to add the number 20 to every word

example i use this to create the 20 word .txt but i want to know how to add the number 20 at once to every word i created on the .txt file

   fae@kali:~$ cat faepass.txt
   fae@kali:~$ cat faepass.txt
   fae@kali:~$ echo 'user' > faepass.txty 
   fae@kali:~$ cat faepass.txty
   user
   fae@kali:~$ echo 'password' >> faepass.txty
   fae@kali:~$ cat faepass.txty
   user
   password
   fae@kali:~$ 
  • Your question is unclear. Maybe it has too much unnecessary detail, like your Linux version and the fact that you mention nano and vim but the code does not use either. When you say registry, do you mean line? Good luck! – Nostradamnit Nov 21 '20 at 10:36

1 Answers1

0

Use awk

awk '{print $0 "20"}' faepass.txty
rohit89
  • 5,745
  • 2
  • 25
  • 42
  • hi thank yo for your reply it does print 20 to faepass.txty however it does not write 20 in the file faepass.txty how can i do that? – Rafael Celis Nov 26 '20 at 04:29
  • @RafaelCelis Well, the simplest way is to use redirection. `awk {...} > newfile.txt`. Then you can delete the old file and rename the new file. – rohit89 Nov 26 '20 at 05:08
  • Thank you for your reply, and yes that solves the problem thank you very much – Rafael Celis Nov 26 '20 at 21:47