I have been toying with this all night now and cannot seem to get it to work, so I came to you for some aid. I recently discovered the wonders of the AWK programming language and how it can be useful of UNIX system administratioin, especially directly from and interacitive interpreter (ala sh).
The FreeBSD development team made it very easy to install pre-compiled binary packages remotely via the pkg_add -r directive which gives you functionality and facility very similiar to that of Debian's famed APT. When issuing a fetch, you do not have to give a specific version number along with the package name in the string, so something such as this will work fine:
One little incovinience that I did come across is, of course, having to look for specific version numbers each time I want to remove a package via the pkg system. This process was tedious and involved looking through pkg_info output for your program and maybe piping it to 'more' or 'less' to scroll through a long list of packages:
This might not seem like a lot to the naked eye, and indeed, it takes but a minute to accomplish, but it does get rather boring and is a minute that could have been well spent elsewhere. I was thinking about how I might accomplish this more time effective.
I needed pkg_info's output to accomplish the bulk of this, so that goes first. I would then have to pipe it to some pattern matching utility and search for my program, which, of course, would not have to be specific. Their is two options here, and my first was the less efficient, but the first to come to mind. The second saves a process. The third will eliminate the need for yet another process. The problem with this and what I need help with will unfold:
This little timeline was how I wrote this in the exact order. The last one is what I stuck with, though. The basic operation of this script is as follows: output package information, look for records with the string "xchat", extract only the first field from the output, and delete the package.
Here is my problem. I have a gnome installation that I would like to get rid of via package managment for the sake of cleanliness. I could do this manually, though it would take me ages to go through every single package with the method above. I tried the following to delete the bulk of the gnome packages:
For all of the above package, I got the a message similar to the following for each:
After a minute or two, I ran this and got the same message as above:
This is the end of the road, and I hope someone might have a solution to this. I was thinking it was going to be something recursive, but i'm studying up on awk a bit more. Thanks in advance...
EDIT:
I just did "man pkg_delete" and came across the -x switch. Here's what it does, which is what the above does too:
I ran "pkg_delete -x gnome" and got the same errors i got early, plus a new one:
Greeting.
How to download messages in bulk in mailx? e.g. how to download all the message received on mar-23-2017 and save as a file or download individual mailx message that received on mar-23-2017 as individual file and as a loop?
We are on HP-UX centstdb B.11.31 U ia64 3294693583... (1 Reply)
Hallo Team,
I would like to change everything on field 24 that starts with
10.0.108.* to be 10.0.108.11
-bash-3.2$ cat pax1.csv|cut -f24 -d","|sort -u
10.0.108.11
10.0.108.11100
10.0.108.11102
10.0.108.11104
10.0.108.11105
10.0.108.11106
10.0.108.11108
10.0.108.11110... (6 Replies)
Hi All, :D
Actullay I am looking for a smart way :b: to parse files in a directory whose count is around 2000000 :eek: in a single day.
Find is working with me but taking a lot of times :confused:, sometimes even a day which is not helping me.:wall:
So anyone can help me know a smart... (5 Replies)
Hi,
I have a bunch of files which are named something like:
Company Name~1234~X1234~X1-123.pdf
I need to get them renamed something like:
Company Name~1234(X1234)X1-123.pdf
Once I have the X1234 inside () I have a piece of software which can use the X1234 bit. I will be receiving... (7 Replies)
Hi Friends,
I have a directory with a ton of .html files, like this
ls -m1 dir
1.html
2.html
3.html
4.html
Somewhere in the files, there is a pattern like this
1.html
http://unix.com/cgi-bin/task?taskid=12010&task.out
2.html
http://unix.com/cgi-bin/task?taskid=11110&task.out... (1 Reply)
hi,
my directory has the following files
I want to rename or mv them as
file 1 corresponds to new_1.bed, file2 to new_2.bed and so on.
How do I do it using awk or bash? TIA (4 Replies)
Under smit, one has to manually select each fix with F7. there 9000 fixes left to be marked. How Can I manually install/Mark all of these without SMIT.
---------- Post updated at 02:29 PM ---------- Previous update was at 01:15 PM ----------
From the command line
instfix -T -d... (4 Replies)
Hello there,
My mulithreaded application (which is too large to represent the source code here) is crashing after installing FreeBSD 7.1-RELEASE/amd64.
It worked properly on others machines (Dual Cores with 4GB of RAM - FreeBSD 6.2-RELEASE/i386).
The current machine has 2x Core 2 Duo... (1 Reply)
Hello,
I am trying to rename bulk files however i dont think the rename/mv command is giong to help me here. here is a quick snapshot of the files I need to rename:
75008040 -rw-r----- 1 root root 8716 May 8 05:00 10.9.144.2
75008041 -rw-r----- 1 root root 11700 May 8 05:00 10.9.160.2... (10 Replies)
Hello chiefs,
So i wanna outcomment several lines, but i dont want to start each line with #-sign. Once i saw it in use, but dont remember the syntax. It should work with sh or ksh.
regards
congo (3 Replies)