Reputation
284
Top tag
Next privilege 300 Rep.
Create new tags
Badges
4 16
Impact
~22k people reached

  • 0 posts edited
  • 1 helpful flag
  • 46 votes cast
2d
awarded  Notable Question
Dec
13
awarded  Yearling
Dec
3
awarded  Popular Question
Sep
17
awarded  Popular Question
Aug
5
comment Make many subdirectories at once
bash user here. +1 for you. Concise and easy to remember :)
Jul
31
awarded  Notable Question
Jul
2
awarded  Curious
May
9
awarded  Notable Question
May
2
awarded  Popular Question
Apr
5
awarded  Popular Question
Dec
9
awarded  Popular Question
Oct
22
awarded  Popular Question
Jan
17
awarded  Popular Question
Jan
10
asked is it possible to create a file given an md5 hash
Dec
28
comment Bash variable in Awk script
@manatwork, I'm using gawk (as I'm on RHEL 5.4)
Dec
28
comment bash string extraction
@AlexandreAlves, if you will notice, the one I'm interested at is not always at the 3rd column but is always 2nd from last column. So your solution from the very beginning was faulty. But thanks for trying :)
Dec
28
comment bash string extraction
you have a minor typo, your second statement should have referred to $all_but_last_field like second_to_last_field=${all_but_last_field##*.}. I'm accepting your answer as it's pure bash but the answer of Drake Clarris was great as well. It's actually even more compact but I can only choose 1 answer. Thanks guys :)
Dec
28
comment bash string extraction
gniourf_gniourf & manatwork: great solution. I'm not so well versed with awk but with your help, I'm learning some more about it. +1 to both of you :)
Dec
28
accepted bash string extraction
Dec
28
comment bash string extraction
+1 to Drake Clarris for providing original solution and +1 for you manatwork too for reviewing the code. But yup, I agree with the Drake Clarris' solution, he was trying to be much more practical. But your solution would help in case my pattern changes :)