Skip to content

Instantly share code, notes, and snippets.

@toransahu
Created August 1, 2018 06:56
Show Gist options
  • Select an option

  • Save toransahu/f812260a37947a299c5c26adddfa4cfa to your computer and use it in GitHub Desktop.

Select an option

Save toransahu/f812260a37947a299c5c26adddfa4cfa to your computer and use it in GitHub Desktop.
substring comarision in bash
#! /bin/sh
#
# backup_confs.sh
# Copyright (C) 2018 Toran Sahu <[email protected]>
#
# Distributed under terms of the MIT license.
#
. ~/paths.sh
string="$(hostname)"
substr="mint"
if [ -z "${string##*$substr*}" ]; then
dconf dump /org/cinnamon/ > "$TARGET_DIR/cinnamon_backup_$HOSTNAME"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment