I'm getting sed: -e expression #1, char 35: unterminated s' command when I try and run the following script. Any ideas?

# This script is to be used to re-write a configuration file
# replacing select values, SSID, IP, device name, gateway,
# and frequency with the supplied command line arguments.
# example: ./configure input-file, SSID, IP, device-name, gateway, frequency

sed -e 's/\(wireless\.1\.ssid=\).*/\${SSID}'             \
    -e 's/192\.168\.1\.20$/${IP}/g'                      \
    -e 's/\(NanoBridge M.\)/\${DEVICE}/g'                \
    -e 's/\(route\.1\.gateway=\).*/\${GATEWAY}/g' ${FILE} > /home/garrett/Desktop/NEW-CONFIG.txt

Recommended Answers

All 4 Replies

I think you wanted this:


to be this:


I removed the /g and I got the same thing.

I removed the /g

You mean "added", right?

Yea, thanks. Now it's actually replacing the text the the strings "${SSID}", "${DEVICE}", etc. Any further input?

Be a part of the DaniWeb community

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