Results 1 to 4 of 4
i am trying to enable/disable repositories with a script.
with sed i've been able to find a repo:
Code:
sed '/*'"$REPO"'/,/src/ s/^[ #]*//' /etc/apt/sources.list
however, like this it also enables ...
- 02-20-2010 #1
[SOLVED] Edit sources.list from script
i am trying to enable/disable repositories with a script.
with sed i've been able to find a repo:
however, like this it also enables the src repo (even though "src" is set as the stop).Code:sed '/*'"$REPO"'/,/src/ s/^[ #]*//' /etc/apt/sources.list
how can i enable a repo (e.g. remove the comment for that repo) without enabling the source repo as well at the same time?
all help much apreicated
- 02-20-2010 #2Linux User
- Join Date
- Jan 2007
- Location
- cleveland
- Posts
- 452
did you try without the range pattern?
i.e. omit the ",/src/"the sun is new every day (heraclitus)
- 02-20-2010 #3
- 03-14-2010 #4
i solved this in a "hackish" way, concatenating the search term and omitting the search range:
Code:sed "/#.*$REPO.*$SRCH/ s/^[ #]*//" /etc/apt/sources.list



