Sponsored Content
Top Forums Shell Programming and Scripting Modify sources.list from script Post 302397071 by Leppie on Saturday 20th of February 2010 05:17:19 PM
Old 02-20-2010
Modify sources.list from script

i'm looking for a way to enable and disable repositories from a script.
i started with a sed command like this:
Code:
sed '/*'"$REPO"'/,/'"$STOP"'/ s/^[ #]*//' /etc/apt/sources.list

but this enables both the normal and the source repos.
for example:
Code:
# deb http://www.lamaresh.net/apt lenny main
# deb-src http://www.lamaresh.net/apt lenny main

anybody knows of a way to control just one? e.g. just add/remove the # from the concerning repo line?

all help much appreciated Smilie

ps, sorry if this is in the wrong section.

Last edited by Leppie; 02-20-2010 at 06:37 PM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Is it possible in a shell script to modify itself ??

We are running a quiz and the data collected from the quiz is submitted to the database. My requirement is to write a shell script to get these submitted records. I should be able to run this shell script at any time and the records it returns should be the ones submitted after the script was... (5 Replies)
Discussion started by: sehgalniraj
5 Replies

2. Shell Programming and Scripting

Modify Perl script to work with txt - Permissions script

Hi I have this code, and i want work with a ls -shalR output in .txt What i need read to do this?? Where start? #!/usr/bin/perl # Allrights- A perl tool for making backups of file permissions # Copyright (C) 2005 Norbert Klein <norbert@acodedb.com> # This program is free... (1 Reply)
Discussion started by: joangopan
1 Replies

3. Shell Programming and Scripting

Request to modify script to list multiple parameters for V_fieldid variable

I am posting a script below which essentially excutes the following functions in the described order. 1) From a source directory pools together three files generated by system logs for each user session, tar's these files and archives them as a log set in a destination directory and these... (0 Replies)
Discussion started by: Sammy
0 Replies

4. Shell Programming and Scripting

Please help to modify my script

Hi, I have a script which connect to ATM's and pull two files from the ATM. The which i try to pull is like PIC20085200001*.JPG First 7 digit consist of year montn and date as well After todays execution i want to change the date to next date I add few lines in the script but it is not... (6 Replies)
Discussion started by: Renjesh
6 Replies

5. Shell Programming and Scripting

script to modify /etc/shadow

Hi I am looking for script to modify /etc/shadow. For example: 1-)User enters username 2-)The line of that user is found in /etc/shadow and *LK* is added infront of the second field in /etc/shadow. How can I do this? Thanks (7 Replies)
Discussion started by: tjay83
7 Replies

6. Shell Programming and Scripting

List files and display last modify time in a particular format

hi everyone, can someone suggest how i can list the contents of a directory and display their corresponding last modify time in the format yyyymmddhhmm? thanks in advance! (16 Replies)
Discussion started by: Deanne
16 Replies

7. Shell Programming and Scripting

how can I modify this script.

hello forum members, I have a script which is used find the Uname and passwords and redirects into a output.txt file.I hardcoded a string "ciadev" but iwant search two more strings also "absdev" and "absprod" So modify this script please. I am lookinmg forward from you, please find the below... (2 Replies)
Discussion started by: rajkumar_g
2 Replies

8. Shell Programming and Scripting

Script to List, Modify, replace filename for an upload?

Hello, here is my problem: I have ma program in a first directory dir1: ls path1/rep1/ file1.f90 file1.f90~ file1.o file2.f90 .... etc... I have modified folder in an other directory: ls path2/rep2/ file1_modified.f90 file2_modified.f90 .... etc... All files from first... (8 Replies)
Discussion started by: shadok
8 Replies

9. Debian

Repositories in sources.list

I'm just interested to know how your sources.list look like. I got some repositories witch give some errors and I would like to clean it up. and when I do apt-get update I get few lines showing errors like 404 , this is how my list look like: # deb cdrom:/ squeeze main # deb cdrom:/... (0 Replies)
Discussion started by: zdorian
0 Replies
APT_AUTH.CONF(5)							APT							  APT_AUTH.CONF(5)

NAME
apt_auth.conf - Login configuration file for APT sources and proxies DESCRIPTION
APT configuration files like sources.list(5) or apt.conf(5) need to be accessible for everyone using apt tools on the system to have access to all package-related information like the available packages in a repository. Login information needed to connect to a proxy or to download data from a repository on the other hand shouldn't always be accessible by everyone and can hence not be placed in a file with world-readable file permissions. The APT auth.conf file /etc/apt/auth.conf can be used to store login information in a netrc-like format with restrictive file permissions. NETRC-LIKE FORMAT The format defined here is similar to the format of the ~/.netrc file used by ftp(1) and similar programs interacting with servers. It is a simple token-based format with the following tokens being recognized; Unknown tokens will be ignored. Tokens may be separated by spaces, tabs or newlines. machine hostname[:port][/path] Entries are looked up by searching for the machine token matching the hostname of the URI apt needs login information for. Extending the netrc-format a portnumber can be specified. If no port is given the token matches for all ports. Similar the path is optional and only needed and useful if multiple repositories with different login information reside on the same server. A machine token with a path matches if the path in the URI starts with the path given in the token. Once a match is made, the subsequent tokens are processed, stopping when the end of file is reached or another machine token is encountered. login name The username to be used. password string The password to be used. EXAMPLE
Supplying login information for a user named apt with the password debian for the sources.list(5) entry deb http://example.org/debian stretch main could be done in the entry directly: deb http://apt:debian@example.org/debian stretch main Alternatively an entry like the following in the auth.conf file could be used: machine example.org login apt password debian Or alternatively within a single line: machine example.org login apt password debian If you need to be more specific all of these lines will also apply to the example entry: machine example.org/deb login apt password debian machine example.org/debian login apt password debian machine example.org/debian/ login apt password debian On the other hand neither of the following lines apply: machine example.org:80 login apt password debian machine example.org/deb/ login apt password debian machine example.org/ubuntu login apt password debian machine example.orga login apt password debian machine example.net login apt password debian NOTES
Basic support for this feature is present since version 0.7.25, but was undocumented for years. The documentation was added in version 1.5 changing also the implementation slightly. For maximum backward compatibility you should avoid multiple machine tokens with the same hostname, but if you need multiple they should all have a path specified in the machine token. FILES
/etc/apt/auth.conf Login information for APT sources and proxies in a netrc-like format. Configuration Item: Dir::Etc::netrc. SEE ALSO
apt.conf(5) sources.list(5) BUGS
APT bug page[1]. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug-reporting.txt or the reportbug(1) command. AUTHOR
APT team NOTES
1. APT bug page http://bugs.debian.org/src:apt APT 1.6.3ubuntu0.1 17 August 2017 APT_AUTH.CONF(5)
All times are GMT -4. The time now is 06:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy