Disclaimer: I did not set out to write the next big thing...
I'm simply collecting all of the group information for all of the users across disparate hosts.
I wrote a simple script to collect all of the group information for each user on a system and pushed it out to each host:
I collected them on a central host
To clean it up and move each new group onto it's own line, I quickly ran it through tr
But now, I'm left with a handful of files that look like this:
Ideally, I'd like the file to look like this:
And then I'll collect them all together with a simple:
This is a file that I can drop into Excel to get moving on my UID/GID cleanup plan.
I've been playing with this for 30 minutes, but need to go home before I start seeing hash marks everywhere.
If you have a great idea to do this all from go to whoa, great, but all I'm really looking for is that one piece. I'll munge it all together later, just looking for "quick and dirty" right now...
I'm getting multiple lines for users that are actually groups. I'll approach this from another angle.
I've slightly modified my original scripts to do the following:
1. Run this script on each of the unique hosts
The above script provides the results below:
2. Collect the data with this script to an appropriate directory:
3. Run a script to clean it up with results in the format of:
$host:username:group
$host:username:group2
...
I've tried mangling the script provided by Tyler, but it just doesn't work reliably. I will throw together a quick perl script to break it into a hash with array members. It's not as smooth as I'd like, but it will get me through this problem. I'll post the .pl here after lunch.
Dear all,
I am new to shell scripting and have tried to make a small program for fun sake that tells age from the last number of cell phone and birth year.
At the end we get a final 3 digit number and the first digit represents the last digit of cell phone and rest 2 numbers shows age. eg. 423... (4 Replies)
I'm looking for a way to neaten up the out put of an ldapquery. I might get one, none, or several returns for each query; and each query consists of multiple lines. And while each return will contain the same types of info, it might be in a different order, like:
uniq: 1
ip: 192.168.2.3... (3 Replies)
there is one shell which calls for different sql scripts.
output of different are formatted in frame like structure.i want columnar wise formatting to be done in such a manner that output of one sql may be comon input of rest sqls .
ERC DML
Closure Date
ER DML
SAP Transfer Date
... (0 Replies)
Hi,
Can anyone tell me how i can convert all tab spaces inside a script to 4 spaces through another script.
Also i need to find if all the quotes are matching and ended properly. Any idea whould be of great help.
Many thanks! (3 Replies)
Dear readers,
I have a script that counts the number of files in particular directories in my home location and displays the output. Now I have 13 directories in my home location. I am getting the output as :
Avishek_dir 13
Kunal_dir 17
Shantanu_dir 18
Arup_dir 12
Pranabesh_dir 19
.
.... (7 Replies)
Hi
I have to convert the data in a file
*******
01-20-09 11:14AM 60928 ABC Valuation-2009.xls
01-20-09 11:16AM 55808 DEF GHI Equation-2009.xls
01-20-09 11:02AM 52736 ABC DF Valuation-2009.xls
01-20-09 11:06AM 89600 THE... (6 Replies)
Hello,
I have got the following kine in my script
awk '{printf("%s,", $0);next}{printf("%s", $0)}' ORS="," a.txt > b.out
The contents of b looks somewaht like this:
QUEUE(QUEUE1.Q),CURDEPTH(0),QUEUE(QUEUE2.Q),CURDEPTH(0),QUEUE(QUEUE3.Q),CURDEPTH(0)
But my desired output is :... (10 Replies)
Hello all,
Can somebody please offer some advice. I'm working on a small script to list all packages on the local and remote systems and need it in the following format.
Machine Name, Package, Version
Here is what i have so far but i can't seem to get the output of the hostname to loop to... (3 Replies)
Hi,
Can anybody throw somelight on how to handle date in a shell script?
I need to pass the date in this format 'yymmdd' and then pad it to a file.
The way in which i've handled is given below, but the date is not getting passed rather the file is getting created with a null date. Any... (2 Replies)