Ok, this is about the script i expected. It has several problems, but first, lets analyze your problem correctly. Software engineering (and script programming is a form of software engineering) is about correctly analyzing the problem before you envision a solution.
Your "find" command compares dates - the date/time the file local.cshrc has been changed to when the file index.html in the users home directory. If a new user is created after the last change of the skeleton file his file ~/index.html will be newer regardless of being changed or not. On the other hand if the skeleton file is changed even the files reported as changed before will be reported as not changed. So you don't find the correct files in first place.
Lets see: when a new user is created s/he is delivered some standard version of index.html. If s/he changes it it will differ from this standard file, if not then not. Now this is indeed a criterion which will pick out the right files, yes?
So, your task is to find a unix utility which compares two files and finds out if they differ or not. If there is such an utility we could write the following program (in pseudocode):
Code:
while (cycle through all users)
do
if (~thisusers/index.html is equal to the standard index.html)
do nothing
else
write a corresponding line to your output file
endif
enddo
There are two things you can do for now:
1) find a way to get all the users names. (You will need this to set up the while-loop above.) I could tell you, but i don't want to spoil your fun finding it out.
2) find a unix command which compares two files and finds out if they are equal (you will need this for deciding the if-construction).
Report back here with your answers and i will give you the directions for the next stage.
Sorry for dragging this out this way, but i cannot give you enough directions at once without giving away the solution. As the spirit of this board is to help you learn and not spoon-feed you solutions we have to do it this way. As i am convinced you will soon find out Unix is not only a lot of fun to work with but also a lot of fun to learn about, so enjoy it while the learning experience lasts.
Hello Awk Gurus,
Can anyone of you help me with the below problem. I have got a file having data in below format
pmFaultyTransportBlocks
-----------------------
9842993
pmFrmNoOfDiscRachFrames
-----------------------
NULL
pmNoRecRandomAccSuccess
-----------------------... (4 Replies)
Hi!
I am writing a script handling downloading list of files and I have to check whether file is present locally and if not finished than continue downloading. To do so I have to compare sizes of remote file and local file.
To check remote file size I have to parse something like this:
... (2 Replies)
Hi all
I use aix (sadly).
I've got a file consisting of fields separated by commas, I need a sed or awk command that will delete all spaces between two commas as long as there are only spaces between the commas.
eg
,abc, ,sd , ,dr at
would become
,abc,,sd ,,dr at
I have... (53 Replies)
Hello,
i have a file, i open the file and read the line, i want to get the first item in the csv file and also teh third+6 item and wirte it to a new csv file. only problem is that using echo it takes TOO LONG:
please help a newbie. below is my code:
WorkingDir=$1
FileName=`cut -d ',' -f... (2 Replies)
Hi all,
I have a list that I would like to parse with awk/sed. The list is contains entries such as:
JournalTitle: Biochemistry
JournalTitle: Biochemistry and cell biology = Biochimie et biologie cellulaire
JournalTitle: Biochemistry and experimental biology
JournalTitle: Biochemistry and... (6 Replies)
HI All,
I am new to unix. I have a file would like to do some editing by using awk, cut and sed. Could anyone help?
This file contain 100 lines. There are one line for example:
2,"102343454",5060,"579668","579668","579668","SIP",,,"825922","035885221283026",1,268,"00:59:00.782 APR 17... (2 Replies)
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Dear All,
Can anyone help to remove the , bewteen "" in a string by using sed or awk?
e.g.
input : 1,4,5,"abcdef","we,are,here",4,"help hep"
output:1,4,5,"abcdef","wearehere",4,"help hep"
Thanks,
Mimi (5 Replies)
Sorry for the long/weird title but I'm stuck on a problem I have. I have this XML file:
</member>
<member>
<name>TransactionID</name>
<value><string>123456789123456</string></value>
</member>
<member>
<name>Number</name>
... (9 Replies)
I have a file comp.pkglist which mention package version and release . In 'version change' and 'release change' line there are two versions 'old' and 'new' Version Change: --> Release Change: -->
cat comp.pkglist
Package list: nss-util-devel-3.28.4-1.el6_9.x86_64
Version Change: 3.28.4 -->... (1 Reply)
Discussion started by: Paras Pandey
1 Replies
LEARN ABOUT SUSE
kbookmarkmerger
KBOOKMARKMERGER(1) KDE User's Manual KBOOKMARKMERGER(1)NAME
kbookmarkmerger - A program for merging a given set of bookmarks into the user's list of bookmarks.
SYNOPSIS
kbookmarkmerger [Qt Options...] [KDE Options...] {directory}
DESCRIPTION
kbookmarkmerger is a program for merging a given set of bookmarks into the user's set of bookmarks; if the user doesn't have any bookmarks
created yet, a new bookmark list is created and the given bookmarks are inserted into it. While doing this, kbookmarkmerger keeps track of
which files were merged in a previous run already, so no bookmark will get installed to the user's bookmarks more than once. In case KDE is
running while kbookmarkmerger is executed, the KDE bookmark subsystem will be informed of any changes to the user's bookmarks, so that all
applications accessing that information (i.e. Konqueror) will pick the changes up instantly.
The traditionally used approach to achieve something like this was to use carefully crafted skeleton home directories when creating a new
user account, to provide the user with a standard set of bookmarks. The problem with this approach is that after the user account has been
created, no new bookmarks can be propagated.
This mechanism is useful for system administrators who want to propagate a bookmark pointing to a certain document (for instance, important
notes about the system) to all users. Distributors might find it useful as well, for instance by augmenting the software packages they sup-
ply with bookmark files which kbookmarkmerger merges into the user's bookmark list when the package is installed. That way, documentation
shipped with a software package is easily and visibly accessible right after the package has been installed.
The only parameter required by kbookmarkmerger is the name of a directory which shall be scanned for bookmark files. All files in the given
directory will be considered for being merged into the user's setup. The files in the given directory should be valid XBEL files.
SEE ALSO
Konqueror manual: help:/konqueror/index.html
EXAMPLES
joe@hal9000:~> kbookmarkmerger /usr/local/extra-bookmarks
Merges all bookmark files stored in /usr/local/extra-bookmarks into joe's list of bookmarks.
STANDARDS
XBEL specification: http://pyxml.sourceforge.net/topics/xbel/
RESTRICTIONS
When determining whether a given bookmark file has been merged into the user's bookmarks already or not, kbookmarkmerger merely looks at
the filename of the bookmark file - the contents are not checked at all. This means that changing a bookmark file which was already merged
into a user's bookmarks will not trigger merging it once again.
Also note that in case a user modifies a bookmark which was merged into his setup, the original bookmark file will be left unmodified.
AUTHOR
Frerich Raabe <raabe@kde.org>
AUTHOR
Frerich Raabe.
K Desktop Environment February 1st, 2005 KBOOKMARKMERGER(1)