0

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

#/bin/bash
#
#
# 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
#
#
FILE=${1}
SSID=${2}
IP=${3}
DEVICE=${4}
GATEWAY=${5}

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
#END#
3
Contributors
4
Replies
24
Views
4 Years
Discussion Span
Last Post by lewashby
0

I think you wanted this:

 's/\(wireless\.1\.ssid=\).*/\${SSID}'

to be this:

 's/\(wireless\.1\.ssid=\).*/\${SSID}/g'
0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.