Подтвердить что ты не робот

Что делает bash -c?

Я выполнил следующий учебник: http://davidtsadler.com/archives/2012/06/03/how-to-install-magento-on-ubuntu/

В какой-то момент он сказал мне выполнить следующую команду:

sudo bash -c "cat >> /etc/apache2/sites-available/magento-store.com <<EOF
<VirtualHost *:80>

  ServerName  localhost.magento-store.com
  ServerAlias www.localhost.magento-store.com

  DocumentRoot /home/dev/public_html/magento-store.com/public

  LogLevel warn
  ErrorLog  /home/dev/public_html/magento-store.com/log/error.log
  CustomLog /home/dev/public_html/magento-store.com/log/access.log combined

</VirtualHost>
EOF"

И я хотел бы, чтобы кто-то сказал мне, что сделала эта команда, и как я могу отменить это, я перезапустил компьютер, и кажется, что он все еще работает. Я заглянул в .bashrc и .profile, но не нашел его внутри.

4b9b3361

Ответ 1

Цитата из man bash:

   -c string If the -c option is present,  then  commands  are  read  from
             string.   If  there  are arguments after the string, they are
             assigned to the positional parameters, starting with $0.

Приведенная вами команда добавит текст в heredoc (т.е. текст в теге VirtualHost) в файл /etc/apache2/sites-available/magento-store.com.

Ответ 2

man bash говорит, что опция -c выполняет команды из строки; то есть. все внутри цитат. Что касается вашего второго вопроса, я не совсем понимаю, что вы спрашиваете.

Ответ 3

просмотрите страницы руководства либо на вашем компьютере, либо в Интернете, например этот.

Цитата:

-c string
     If the -c option is present, then commands are read from string. 
     If there are arguments after the string, they are assigned to the positional 
     parameters, starting with $0.