create file with touch and echo output to that file
i am writing a .repo file using echo command after creating that file with touch command. but i am not able to do what i want.
Code:
echo "[local repo]" "\n" "name=local repository for updating packages" > /etc/yum.repos.d/local.repo Code:
[local_mirror] how can i achieve this task? |
check permissions, usually only root can write to /etc
|
Quote:
|
You need to enable backslash interporetaion of echo. Use the -e option.
Just so we can help you better in future it would have been great if you would have shown what you output was. Just be as verbose as possible and as quiet as feasible. |
Quote:
try this: Code:
echo -e "[local repo]\nname=local repository for updating packages\nbaseurl=http://some/site/some/page\ngpgcheck=0" > /etc/yum.repos.d/local.repo |
Quote:
Thanks to everyone for their valuable time. |
All times are GMT -5. The time now is 12:49 AM. |