return part of a string in bash
Hi,
I would like to return the last part of a string in an array of strings in bash. The array contains in each position the content below: Code:
a.b.c The correct result would be: Code:
c |
This could be achieved using Bash's built-in Parameter Expansion feature:
Quote:
Rob |
Code:
$ ruby -F"\." -ane 'puts $F[-1]' file |
Hi
In bash Code:
#!/bin/bash Code:
#!/bin/bash |
Hi
Try this also awk -F. '{$0=$NF}1' filename |
As an addendum to post #4 using bash:
Code:
#!/bin/bash |
All times are GMT -5. The time now is 03:55 PM. |