Complete the sed command line string that will delete line 7
Complete the sed command line string that will delete line 7 through line 11 inclusively from the file called sedfile.
Solution
Question 1)Complete the sed command line string that will delete line 7 through line 11 inclusively from the file called sedfile.
sed \'#,11d\'sedfile
what would you replace the # with to complete the sed command string above?
Answer) 7
Question 2) Create a sed command line string that will replace ALL the occurrences of X and x with s within the file called sedfile
sed \'s/##/s/g \' sedfile
replace the ## with the BEST correct answer
Answer) X,x
Question 3) which sed command line string will delete any line that begins with the string \'directory\' within the file called sedfile?
Answer) sed \'s/^dir/d\' sedfile
sed \'s/#.*$//\' filename Here # to the end of a line to be treated as a comment
