I am trying to automate the addition of a repository source in my arch\'s pacman.conf file but using the echo
command in my shell script. However, it fails like th
STEP 1 create a function in a bash file (write_pacman.sh
)
#!/bin/bash
function write_pacman {
tee -a /etc/pacman.conf > /dev/null << 'EOF'
[archlinuxfr]
Server = http://repo.archlinux.fr/\$arch
EOF
}
'EOF'
will not interpret $arch
variable.
STE2 source bash file
$ source write_pacman.sh
STEP 3 execute function
$ write_pacman