Tiny Core Base > Raspberry Pi

split a string

(1/2) > >>

jnovacek:
how to split a string in bash?
IFS=', ' read -r -a array <<< "$string"
does not work

thanks

bmarkus:
This question has nothing to do with RPi nor TC. Please use generic support forums and Google. First hit in Google search is

http://stackoverflow.com/questions/918886/how-do-i-split-a-string-on-a-delimiter-in-bash

Once again. Use this forum for TC specific questions only.

THANKS!

jnovacek:
in other distributions it works, it does not work on Raspberry PI (Tiny Core Linux 7.0),
I get the message "syntax error: unexpected redirection"

Greg Erskine:
Are you using bash?

gavinmc42:
Standard LInux stuff, grep, sed, awk, these can be used in shell scripts.
All available in busybox on piCore.
Extremely powerful and highly obscure languages and commands 8)
I use  them to split out variables in config files and for data sorting.
One line of shell script with these in it can do the same as 100s of lines of python.
If you want to get really fancy then Perl, PHP.

Navigation

[0] Message Index

[#] Next page

Go to full version