General TC > Remasters / Remixes - Unofficial

Bash code messes up at reamaster run-time

(1/1)

kzpm:
Hi tc-ers!

I'm still busy to fine-tune a remaster webkiosk based on TinyCore-current.iso

For remote administration purposes, I want to collect remote ip's from users.
The script to extract the remote IP is as follows

--- Code: ---cd /home/tc/.X.d/

cat >> get_remote_ip << STOP
#!/bin/sh
..
result="$(wget -q -O - http://checkip.dyndns.org)"
wait $!
..
exit
STOP
chmod a+x get_remote_ip

--- End code ---

When checking the script while the remaster is in operation, it looks like the script commands starting with "result" and "wait" are distorted.
It shows only
"result=" and "wait="
All instructions after the "=" operator vanished..

What is the best way according to you, to retain these commands at runtime?

Kind regards,

kzpm

gerald_clark:
Your $() and $! are being evaluated not copied.
If you want the lines copied, quote the $ characters.
Ex: \$(

Also, don't double post.

kzpm:
Thanks Gerald_clark!

I removed my post already on the "wrong" forum. It was not my intention to double post..

Regards,
Kzpm

curaga:
As an alternative, quote your EOF marker.  cat > file << "EOF"

Navigation

[0] Message Index

Go to full version