I have a Korn shell script that I would like to change a variable based on another and a regex.
What I want to happen is to generate a variable value like below, but without calling sed:
$ echo 'orl,bdl,lap' | sed "s/,*orl//" | sed "s/^,*//"
bdl,lap
$ echo 'orl,bdl,lap' | sed "s/,*bdl//" | sed "s/^,*//"
orl,lap
$ echo 'orl,bdl,lap' | sed "s/,*lap//" | sed "s/^,*//"
orl,bdl
I've tried variations of
export b="orl,bdl,lap"
export a=${b}*(,*lap)
but usually get an error. Is this possible?
I've seen this:
if [[ $var = fo@(?4*67).c ]];then ...
so it should work like it does with filenames.