Using awk:
awk -v username='some username' -v line=32 'NR == line { $0 = $0 username } 1' file To insert the username into the middle of the line, one would have to know more about what the lines in the file looks like.
If the username and line are variables:
awk -v username="$username" -v line="$line" 'NR == line { $0 = $0 username } 1' file If you want to insert a space before the username:
awk -v username="$username" -v line="$line" 'NR == line { $0 = $0 " " username } 1' file