Skip to content

Instantly share code, notes, and snippets.

@thoraxe
Created August 28, 2015 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thoraxe/9fd15926a261a9767cf2 to your computer and use it in GitHub Desktop.
Save thoraxe/9fd15926a261a9767cf2 to your computer and use it in GitHub Desktop.
function exec_it() {
if [ $verbose == 1 ]
then
echo "$@"
eval "$@"
echo
else
eval "$@" &> /dev/null
fi
}
exec_it oc get namespace default -o json "|" sed -e '/"openshift.io\/sa.scc.mcs"/i "openshift.io/node-selector": "region=infra",' "|" oc replace -f -
oc get namespace default -o json | sed -e /"openshift.io\/sa.scc.mcs"/i "openshift.io/node-selector": "region=infra", | oc replace -f -
sed: -e expression #1, char 27: expected \ after `a', `c' or `i'
error: write /dev/stdout: broken pipe
@Miciah
Copy link

Miciah commented Aug 28, 2015

Maybe the following?

exec_it oc get namespace default -o json "|" sed -e \''/"openshift.io\/sa.scc.mcs"/i "openshift.io/node-selector": "region=infra",'\' "|" oc replace -f -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment