- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Can't get sed to replace string with semicolon.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2012 01:33 PM - edited 06-13-2012 05:51 AM
06-12-2012 01:33 PM - edited 06-13-2012 05:51 AM
I am writing a bash script. In the file /etc/samba/smb.conf, I wish to substitute the string:
; realm = MY_REALM
with the string:
realm = GROUP.COM
notice the semicolon is gone.
SED sees the semicolon as special, and I don't know AWK. Anyone got a one liner:
Thanks again to all who respond to my questions regularly,
To describe my problem in fuller detail as suggested, the command:
sed -i 's/"; realm = MY_REALM"/" realm = GROUP.COM"/g' /etc/samba/smb.conf
has issues with the semicolon.
Solved! Go to Solution.
- Tags:
- sed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2012 05:50 PM
06-12-2012 05:50 PM
Re: Can't get sed to replace string with semicolon.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2012 07:57 AM
06-13-2012 07:57 AM
Solution>>> has issues with the semicolon.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2012 10:42 PM
06-13-2012 10:42 PM
Re: Can't get sed to replace string with semicolon.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2012 12:19 AM
06-14-2012 12:19 AM
Re: Can't get sed to replace string with semicolon.
>has issues with the semicolon.
As Steven said, you have issues with whitespace, not semicolon.