Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

UNIX – SED Remove Comment Lines

Posted on January 23, 2017 By David Kittell

This script will remove all lines that start with # along with all comments.

Whatever file you choose I suggest you view first then execute

sed "/^\s*#/d;s/\s*#[^\"']*$//" /etc/dnsmasq.conf && sed '/^\s*$/d' /etc/dnsmasq.conf
sudo sed -i "/^\s*#/d;s/\s*#[^\"']*$//" /etc/dnsmasq.conf && sudo sed -i '/^\s*$/d' /etc/dnsmasq.conf
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

CentOS Code Fedora Mac OS X Shell Mac OSX Red Hat Ubuntu UNIX UNIX Shell Scripts

Post navigation

Previous post
Next post

Related Posts

Latin1_General_CI_AS Error

Posted on August 8, 2013October 26, 2015

Error: Cannot resolve the collation conflict between “Latin1_General_CI_AS” and “SQL_Latin1_General_CP1_CI_AS” in the equal to operation. When you run into this error simply add “COLLATE Latin1_General_CI_AS” after the column name(s) that you are selecting or comparing and it will work. SELECT MemberID COLLATE Latin1_General_CI_AS FROM UserTable Originally Posted on August 8, 2013Last…

Read More

C# – Windows Phone 8 – SMS Via Program

Posted on December 1, 2015February 12, 2016

using Microsoft.Phone.Controls; using Microsoft.Phone.Tasks; using System; using System.Collections.Generic; using System.Linq; using System.Windows; using System.Windows.Controls; using Windows.Phone.Speech.Recognition; using Windows.System; // Original Credit Goes To: AbundantCode // http://abundantcode.com/how-to-send-sms-in-windows-phone-8-programatically-using-c/ namespace AbundantCodeWP8 { public partial class MainPage : PhoneApplicationPage { public MainPage() { InitializeComponent(); } private void Button_Click_1(object sender, RoutedEventArgs e) { SmsComposeTask SMSCompose…

Read More

SQL Connection Test

Posted on December 3, 2013October 26, 2015

Imports System.Data.SqlClient Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim SqlConn As New SqlConnection Dim SqlConnStr As String = "Server=<Server Name/IP>;Database=<Database Name>;Integrated Security=True" If SqlConn.State = ConnectionState.Closed Then SqlConn.ConnectionString = SqlConnStr Try SqlConn.Open() MessageBox.Show("Succsessfull DB Connnection", "DB Connection Test", MessageBoxButtons.OK, MessageBoxIcon.Information) Catch…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • PowerShell - IIS Remove Site
  • SQLite - Auto-Increment / Auto Generate GUID
  • PowerShell - FTP Upload Directory With Sub-Directories

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • PowerShell - IIS Remove Site
  • SQLite - Auto-Increment / Auto Generate GUID
  • PowerShell - FTP Upload Directory With Sub-Directories
  • Raspberry Pi - Remove Default Apps
  • PowerShell - Change Windows CD/DVD Drive Letter
©2025 David Kittell | WordPress Theme by SuperbThemes