Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Script to change/find/delete/install a specific file Post 302269301 by Great Uncle Kip on Wednesday 17th of December 2008 10:06:32 AM
Old 12-17-2008
All the help so far has been cracking, cheers all!

One last thing i'm just wondering.....

Is there a command where I can check if a directory exists, before removing it? If it does, I want the script to remove it and the proceed to the reinstall. If not, I want it to create it and proceed to the install?

Regards
Kip
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to change a specific character in a file

Hi, I have a data file with following structure: a|b|c|d|3|f1|f2|f3 a|b|c|d|5|f1|f2|f3|f4|f5 I want to change this data to: a|b|c|d|3|f1;f2;f3 a|b|c|d|5|f1;f2;f3;f4;f5 Data in column 5 tells the number of following fields. All fields delimiter after the 5th column needs to be... (6 Replies)
Discussion started by: sdubey
6 Replies

2. UNIX for Dummies Questions & Answers

Change Specific Line of a File

Hi everyone, I am attempting to do something that should be very simple. How do I replace a specific line of a file with different text, and then save that file to its original name? I believe I want to use the sed command with the c option, but I after trying many times, I can't get the right... (10 Replies)
Discussion started by: msb65
10 Replies

3. Shell Programming and Scripting

Change specific ip address in a file

I need to change a line from a xen cfg file using sed if it's possible. The original line is: vif = I want to change ONLY the IP address of the second part ==> ip=10.1.10.4 to another IP --> ip=192.222.11.6 The first one ip=123.456.789.123 keeps untouchable. My new line shoud... (9 Replies)
Discussion started by: iga3725
9 Replies

4. Shell Programming and Scripting

Shell script to find specific file name and load data

I need help as to how to write a script in Unix for the following: We have 3 servers; The mainframe will FTP them to a folder. In that folder we will need the script to look and see if the specific file name is there and load it to the correct table. Can anyone pls help me out with... (2 Replies)
Discussion started by: msrahman
2 Replies

5. Shell Programming and Scripting

how to change specific value for a entry in the file

Hello All, can someone please suggest me a one line command to change a specific value that is associated to an entry in the file. for example #more schedulefile quartz.job.manual.bonus.schedule=0 0 9 ? * * # it should be changed to #more schedulefile... (5 Replies)
Discussion started by: bobby320
5 Replies

6. Shell Programming and Scripting

How to find a file with a specific pattern for current sysdate & upon find email the details?

I need assistance with following requirement, I am new to Unix. I want to do the following task but stuck with file creation date(sysdate) Following is the requirement I need to create a script that will read the abc/xyz/klm folder and look for *.err files for that day’s date and then send an... (4 Replies)
Discussion started by: PreetArul
4 Replies

7. UNIX for Beginners Questions & Answers

Delete columns with a specific title XXX, where the position change in each file

Goodmorning, I know how to cut a string and a column, and how to find a word. I have a file with over 100 columns. All columns have a title in the first line. I have to delete all columns with the XXX title. I can't use cut -f because the position of XXX columns change in each file, and in... (14 Replies)
Discussion started by: echo manolis
14 Replies

8. Shell Programming and Scripting

Count specific character of a file in each line and delete this character in a specific position

I will appreciate if you help me here in this script in Solaris Enviroment. Scenario: i have 2 files : 1) /tmp/TRANSACTIONS_DAILY_20180730.txt: 201807300000000004 201807300000000005 201807300000000006 201807300000000007 201807300000000008 2)... (10 Replies)
Discussion started by: teokon90
10 Replies

9. Shell Programming and Scripting

Find specific pattern and change some of block values using awk

Hi, Could you please help me finding a way to replace a specific value in a text block when matching a key pattern ? I got the keys and the values from a command similar to: echo -e "key01 Nvalue01-1 Nvalue01-2 Nvalue01-3\nkey02 Nvalue02-1 Nvalue02-2 Nvalue02-3 \nkey03 Nvalue03-1... (2 Replies)
Discussion started by: alex2005
2 Replies
APTDCON(1)							    User manual 							APTDCON(1)

NAME
aptdcon - command line client for aptdaemon SYNOPSIS
aptdcon [OPTIONS] DESCRIPTION
aptdcon allows to perform package management tasks, e.g. installing or removing software, using aptdaemon. There isn't any need to be root to run this programme. OPTIONS
-v, --version Show the version number of the aptdcon. -h, --help Show information about the usage of the command. -d, --debug Show additional information on the command line. -i, --install PACKAGES Install the list of PACKAGES. If you want to install more than one package you have to put the package names into quotation marks. --reinstall PACKAGES Reinstall the list of PACKAGES. If you want to reinstall more than one package you have to put the package names into quotation marks. -r, --remove PACKAGES Remove the list of PACKAGES. If you want to remove more than one package you have to put the package names into quotation marks. -p, --purge PACKAGES Purge the list of PACKAGES. If you want to purge more than one package you have to put the package names into quotation marks. -u, --upgrade PACKAGES Upgrade the list of PACKAGES. If you want to upgrade more than one package you have to put the package names into quotation marks. --upgrade-system Upgrade the whole system. --fix-install Try to complete a previously cancelled installation by calling "dpkg --configure -a". --fix-depends Try to resolve unsatisified dependencies. Attention: Currently you don't get a confirmation of the changes, which makes this method quite dangerous since it could remove a lot of packages. --add-vendor-key PUBLIC_KEY_FILE Install the PUBLIC_KEY_FILE to authenticate and trust packages singed by the vendor. --add-vendor-key-from-keyserver PUBLIC_KEY_ID Download and install the PUBLIC_KEY_ID to authenticate and trust packages singed by the vendor. Requires the --keyserver to be set. --key-server KEYSERVER Download vendor keys from the given KEYSERVER. --remove-vendor-key FINGERPRINT Remove the vendor key of the given FINGERPRINT to no longer trust packages from this vendor. --add-repository 'DEB_LINE' Allow to install software from the repository specified by the given DEB_LINE. You have to put quotation marks around the DEB_LINE since it normally contains spaces: 'deb http://ftp.de.debian.org/debian unstable main' --sources-file SOURCES_FILE Specify an alternative sources file to which the new repository should be written. SOURCES_FILE should be only the basename: back- ports.list --list-trusted-vendors Show all trusted software vendors and theirs keys. --hide-terminal Do not attach to the interactive terminal of the underlying dpkg call. --allow-unauthenticated Allow to install packages which are not from a trusted vendor. EXAMPLES
The following command will install the package xterm and remove the package eterm in the same run: $ aptdcon --install "xterm" --remove "eterm" To handle more than one package the names have to be put into quotation marks. The following command will install xterm and eterm: $ aptdcon --install "xterm eterm" The following command will add the backport repository to the sources.list in a separate file /etc/apt/sources.list.d/backports.list : $ aptdcon --sources-file backports.list --add-repostiry "deb http://archive.backports.org/debian stable main" DIAGNOSTICS
By default aptdaemon logs to the syslog facility AptDaemon. Furthermore you can use the -d option to get additional information on the com- mand line. HOMEPAGE
https://launchpad.net/aptdaemon BUGS
You can report bugs at the Launchpad site of aptdaemon: https://bugs.launchpad.net/aptdaemon/+filebug AUTHOR
Sebastian Heinlein <devel at glatzor dot de> SEE ALSO
aptd(1), org.debian.apt(7), org.debian.apt.transaction(7) aptdaemon December 2009 APTDCON(1)
All times are GMT -4. The time now is 07:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy