Skip to main content
Reformulate to avoid the ambigous "save". From comments it looks like what's needed is the string following the dot, not preceding it
Source Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k

bash: saveextract only the characterspart of the string following/proceeding the full-stopdot

Say I have a string such as

="/home/Rob/.SpaceVim"

and I want to save onlyextract the charactersstring following/proceeding the full-stopdot. How do I do this?

I know $ is also used to represent the last character, and \ can be used to make character in string literal. So I've tried stuff like awk '\.$' but not had any success.

Thanks in advance,

Rob

bash: save only the characters following/proceeding the full-stop

Say I have a string such as

="/home/Rob/.SpaceVim"

and I want to save only the characters following/proceeding the full-stop. How do I do this?

I know $ is also used to represent the last character, and \ can be used to make character in string literal. So I've tried stuff like awk '\.$' but not had any success.

Thanks in advance,

Rob

bash: extract only the part of the string following the dot

Say I have a string such as

="/home/Rob/.SpaceVim"

and I want to extract the string following the dot. How do I do this?

I know $ is also used to represent the last character, and \ can be used to make character in string literal. So I've tried stuff like awk '\.$' but not had any success.

text to code, edited title
Source Link

Very simple BASH question bash: save only the characters following/proceeding the full-stop

Say I have a string such as ="/home/Rob/.SpaceVim"

="/home/Rob/.SpaceVim"

and I want to save only the characters following/proceeding the full-stop. How do I do this?

I know $$ is also used to represent the last character, and \\ can be used to make character in string literal. So I've tried stuff like awk '.$'awk '\.$' but not had any success.

Thanks in advance,

Rob

Very simple BASH question

Say I have a string such as ="/home/Rob/.SpaceVim"

and I want to save only the characters following/proceeding the full-stop. How do I do this?

I know $ is also used to represent the last character, and \ can be used to make character in string literal. So I've tried stuff like awk '.$' but not had any success.

Thanks in advance,

Rob

bash: save only the characters following/proceeding the full-stop

Say I have a string such as

="/home/Rob/.SpaceVim"

and I want to save only the characters following/proceeding the full-stop. How do I do this?

I know $ is also used to represent the last character, and \ can be used to make character in string literal. So I've tried stuff like awk '\.$' but not had any success.

Thanks in advance,

Rob

Source Link
1toneboy
  • 493
  • 1
  • 4
  • 16

Very simple BASH question

Say I have a string such as ="/home/Rob/.SpaceVim"

and I want to save only the characters following/proceeding the full-stop. How do I do this?

I know $ is also used to represent the last character, and \ can be used to make character in string literal. So I've tried stuff like awk '.$' but not had any success.

Thanks in advance,

Rob