i've just given a script to update and maintain by my manager, but its bash and i dont know that much about it..

i currently have a script that looks through .txt files for given serials that then reports to a php webpage.

within this script we have around 20 variables 1 for each testset labelled ts1 - ts20

most the testsets have a standard 7 digit serial that we look for and this is what is assigned to each variable..eg

TS1=1234567
TS2=2345678

however i have one testset that has a unique serial because of the tests it carries out.
710000/393

i have tried
TS20=710000/393
TS20="710000/393"
TS20=710000"/"393

but no matter what i do it wont read it even though the testsheets read this serial.
is there somthing i am doing wrong with the variable? i thought encapsulating it would allow the / to be read properly

Your second example should work. What platform+version+kernel+bash version are you running? You could try this:

TS20="710000\/393"

as an option.

hi,

$ TS20="710000/393"
$ echo "$TS20"
710000/393

how do get variables from txt file?
I'm not sure it's a bash problem, but rather a php one.
Did you test bash script without being called in php?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.