Skip to main content
added 45 characters in body; edited tags
Source Link
terdon
  • 252.9k
  • 69
  • 481
  • 720

I have a file called output.txt on my ubuntu server, how do I use sed or grep to check if the last two characters in the file are "nt" The text in the file is below, I expect my if statement to return true in this case.

The Senate passed a six-bill package to fund parts of the federal government through September, narrowly avoiding a partial shutdown The upper chamber voted 75 to 22, sending the bill to President Biden's desk before a midnight deadline Mr. Biden was expected to sign the bill Saturday Republicans' demands for amendment votes on immigration-related and other measures slowed its passage and threatened to push the final vote to Saturday, after funding lapsed "We have good news for the country," Senate Majority Leader Chuck Schumer, a New York Democrat, said ahead of vote "We will keep important programs funded for moms and kids, for veterans, for the environment, for housing and so much more. Because both sides cooperated today, we've taken a major step towards our goal of fully funding the government 

The Senate passed a six-bill package to fund parts of the federal government through September, narrowly avoiding a partial shutdown

The upper chamber voted 75 to 22, sending the bill to President Biden's desk before a midnight deadline

Mr. Biden was expected to sign the bill Saturday

Republicans' demands for amendment votes on immigration-related and other measures slowed its passage and threatened to push the final vote to Saturday, after funding lapsed

"We have good news for the country," Senate Majority Leader Chuck Schumer, a New York Democrat, said ahead of vote

"We will keep important programs funded for moms and kids, for veterans, for the environment, for housing and so much more. Because both sides cooperated today, we've taken a major step towards our goal of fully funding the government

I have a file called output.txt on my ubuntu server, how do I use sed or grep to check if the last two characters in the file are "nt" The text in the file is below, I expect my if statement to return true in this case.

The Senate passed a six-bill package to fund parts of the federal government through September, narrowly avoiding a partial shutdown The upper chamber voted 75 to 22, sending the bill to President Biden's desk before a midnight deadline Mr. Biden was expected to sign the bill Saturday Republicans' demands for amendment votes on immigration-related and other measures slowed its passage and threatened to push the final vote to Saturday, after funding lapsed "We have good news for the country," Senate Majority Leader Chuck Schumer, a New York Democrat, said ahead of vote "We will keep important programs funded for moms and kids, for veterans, for the environment, for housing and so much more. Because both sides cooperated today, we've taken a major step towards our goal of fully funding the government 

I have a file called output.txt on my ubuntu server, how do I use sed or grep to check if the last two characters in the file are "nt" The text in the file is below, I expect my if statement to return true in this case.

The Senate passed a six-bill package to fund parts of the federal government through September, narrowly avoiding a partial shutdown

The upper chamber voted 75 to 22, sending the bill to President Biden's desk before a midnight deadline

Mr. Biden was expected to sign the bill Saturday

Republicans' demands for amendment votes on immigration-related and other measures slowed its passage and threatened to push the final vote to Saturday, after funding lapsed

"We have good news for the country," Senate Majority Leader Chuck Schumer, a New York Democrat, said ahead of vote

"We will keep important programs funded for moms and kids, for veterans, for the environment, for housing and so much more. Because both sides cooperated today, we've taken a major step towards our goal of fully funding the government

edited tags
Link
edited tags; edited title
Link

Use sed or grep in bash script to check if file ends with specific string

deleted 4 characters in body
Source Link
Loading
Source Link
Loading