Tuesday, 7 July 2020

How can I strip first X characters from string using sed?

Here's a concise method to cut the first X characters using cut(1). This example removes the first 4 characters by cutting a substring starting with 5th character.
echo "$pid" | cut -c 5-

from : https://stackoverflow.com/questions/11469989/how-can-i-strip-first-x-characters-from-string-using-sed

No comments:

Post a Comment

How to check if a file contains a specific string using Bash

 In case if you want to check whether file does not contain a specific string, you can do it as follows. if ! grep -q SomeString "$File...