I have a file called tmp.mount with the following contents
[Mount]
Options=mode=1777,strictatime,noexec,nosuid
- I'd like to search the file via the word Options= to get the line number.
- I will search the word nodev via the given line number.
- If it does not exist, I will insert the word ,nodev to the end of this line via given line number.
With the results
[Mount]
Options=mode=1777,strictatime,noexec,nodev,nosuid,nodev
All without line break. Most of the solution was to use sed but i'm clueless on how I could incorporate the line search with sed.