this is what I am trying to do
1. Create a script that takes 1 argument being a file, read the inputted file, and look for occurrences of the current user who is executing the script. On finding an occurrence of the username take that line and append it to a file and display a line number and a bracket against the saved line
efforts sofar
Expand|Select|Wrap|Line Numbers
- #!/bin/bash
- echo "filename"
- read myvar
- grep $USER $myvar > results.txt
- nl results.txt
2. Write a script that takes two arguments. The first being a line of text, the second being a file. The script should take the first argument and insert it into the middle (the middle line) of the file named in second argument.
thanks in advancefor any help