Artificial intelligent assistant

Cut delimited with unescaped space? I have a file with text in the format of: User\ Name My\ Password _Notice this is actually a 2 column file, where columns contain escaped spaces._ `cut -d' ' -f2` produces `Name` but I want to produce `My Password`. Is it possible to use `cut` and delimited only based on non-escaped spaces? If not, what alternate command can I use?

I would suggest GNU **`grep`** approach:

Sample `input.txt`:


User\ Name My\ Password
first\ field second\ field


* * *

Cut the 2nd field from _2-columned_ file:


grep -Po '[^\\]\x20\K.*' input.txt


The output:


My\ Password
second\ field


* * *

Or the same with **`sed`** :


sed 's/.*[^\\]\x20\(.*\)/\1/' input.txt


**\----------**

The crucial regex pattern part is `[^\\]\x20` that matches a space `\x20`(space hex code) if it's preceded by any char except escaping backslash `[^\\]`

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 5e318f0182080fa44fa86a517d99a372