Skip to content

Instantly share code, notes, and snippets.

@vguardiola
Created October 22, 2018 12:50
Show Gist options
  • Select an option

  • Save vguardiola/8901527a4949299661c7416c60eb7896 to your computer and use it in GitHub Desktop.

Select an option

Save vguardiola/8901527a4949299661c7416c60eb7896 to your computer and use it in GitHub Desktop.
Add namespaces php
#!/bin/bash
for i in `grep -L 'namespace ' *.php`;
do
path=`pwd`
namespace=${path//\//\\\\};
namespace=${namespace:1};
echo "change file ${i}";
sed -i "2i\
namespace $namespace\
" ${i}
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment