Skip to content

Commit

Permalink
Stripping Trailing Lines: Output same result regardless of ending new…
Browse files Browse the repository at this point in the history
…line
  • Loading branch information
vitorgalvao committed May 31, 2024
1 parent c183d23 commit 79b7714
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"inputType" : 0,
"outputDescription" : "Text",
"outputType" : 1,
"script" : "# Use \"echo\" to prevent extra newline in \"tail\" STDIN\necho -n \"${1}\" | \/usr\/bin\/tail -r | \/usr\/bin\/tail +2 | \/usr\/bin\/tail -r",
"script" : "# Use \"echo\" to prevent extra newline in \"sed\" STDIN\necho -n \"${1}\" | \/usr\/bin\/sed '$d'",
"scriptType" : 5,
"state" : 0,
"taskDescription" : "Get all lines from text but the last",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"inputType" : 0,
"outputDescription" : "Text",
"outputType" : 1,
"script" : "# Use \"echo\" to prevent extra newline in \"tail\" STDIN\necho -n \"${1}\" | \/usr\/bin\/tail -r | \/usr\/bin\/tail +\"$(bc <<< \"${lines_number} + 1\")\" | \/usr\/bin\/tail -r",
"script" : "# Use \"echo\" to prevent extra newline in \"tail\" STDIN\necho -n \"${1}\" | \/usr\/bin\/sed -n -e ':a' -e \"1,${lines_number}\"'!{P;N;D;};N;ba'",
"scriptType" : 5,
"state" : 0,
"taskDescription" : "Get all lines but a number of them from end of text",
Expand Down

0 comments on commit 79b7714

Please sign in to comment.