I got the above to work and it works correctly even when I change the values for $line3 and $line4
question? if I put the printf statement inside the if fi clause it gets bypassed completely and how do I pass variables $line1 and $line2 to sed?
Thanks for explaining the $f to me it help a lot to know where to put echo commands so I could see what was going on.
I am going to run it on a copy of my real directory tree via virtualbox see how it goes.
Is this possible? Let me know If I need specify further on what I am trying to do- I just want to spare you the boring details of my personal file management.
Thanks in advance-
Brian- (2 Replies)
I can't use mysql .How should i config the file of php.ini . the message:
Fatal error: Call to undefined function mysql_errno() in /var/www/html/inc/dv_clssql.php on line 129
how should i do? please help me (2 Replies)
I have a working directory on a server with over 100 INI files. For the most part, they are configured the same way. Each line will contain 1 or none variables listed from the first character in the line such as VariableName=0.
Unfortunately there are comments everywhere using the... (4 Replies)
Hi,
I've spent some time researching for this but can't seem to find a solution. I have a file like this
1234|Test|20101111|18:00|19:00There will be multiple lines in the file with the same kind of format. For every line I need to make it this
1234|Test|20101111|18:00|19:00||create... (5 Replies)
Hello,
I have 50 text files in a directory called "AllFiles"
I want to make a program that will go inside of the "AllFiles" Directory and count the number of lines in each individual text file. Then, the program will calculate how many more lines there are over 400 in each text file and... (7 Replies)
Hi,
I have installed ubuntu server lamp.
When I used the command locate to find the php.ini file I found two location.
/etc/php5/cli/php.ini
/etc/php5/apache2/php.ini
When I want to change the setting of the php, which one of them should I change and why I have this file twice? (3 Replies)
Hi,
I want to append "chr" to all col 2 values of all files in a particular folder.
This is what I came up with but isnt working. Please help.
ls -1 * |
(
while read line
do
awk 'BEGIN {FS=OFS=":"} {$2="chr"$2;print $0}' $line > $line_new
done
)
Another question is, how to delete... (7 Replies)
I am new to Perl. I wrote a Perl program that inserts text "EnableScrollableCursors=3" after a section of contexts in the odbc.ini file matches a variable in an array list. "EnableScrollableCursors=3" is added to a newline before whitespaces separate each section of contexts in the odbc.ini.
... (0 Replies)
How to get a file 'zlib.h' in an entire directory with an excluded directory specified lives under that starting directory by using find command, as it failed on:
$ find . -name 'zlib.h' -a -ipath 'CHROME.TMP' -prune -o -print
it'll just list entirely up (2 Replies)
Discussion started by: abdulbadii
2 Replies
LEARN ABOUT OSX
ini
inifile(n) Parsing of Windows INI files inifile(n)
__________________________________________________________________________________________________________________________________________________NAME
inifile - Parsing of Windows INI files
SYNOPSIS
package require Tcl 8.2
package require inifile ?0.2.3?
::ini::open file ?access?
::ini::close ini
::ini::commit ini
::ini::revert ini
::ini::filename ini
::ini::sections ini
::ini::keys ini section
::ini::get ini section
::ini::exists ini section ?key?
::ini::value ini section key ?default?
::ini::set ini section key value
::ini::delete ini section ?key?
::ini::comment ini section ?key? ?text?
::ini::commentchar ?char?
_________________________________________________________________DESCRIPTION
This package provides an interface for easy manipulation of Windows INI files.
::ini::open file ?access?
Opens an INI file and returns a handle that is used by other commands. access is the same as the first form (non POSIX) of the open
command, with the exception that mode a is not supported. The default mode is r+.
::ini::close ini
Close the specified handle. If any changes were made and not written by commit they are lost.
::ini::commit ini
Writes the file and all changes to disk. The sections are written in arbitrary order. The keys in a section are written in alphabet-
ical order. If the ini was opened in read only mode an error will be thrown.
::ini::revert ini
Rolls all changes made to the inifile object back to the last committed state.
::ini::filename ini
Returns the name of the file the ini object is associated with.
::ini::sections ini
Returns a list of all the names of the existing sections in the file handle specified.
::ini::keys ini section
Returns a list of all they key names in the section and file specified.
::ini::get ini section
Returns a list of key value pairs that exist in the section and file specified.
::ini::exists ini section ?key?
Returns a boolean value indicating the existance of the specified section as a whole or the specified key within that section.
::ini::value ini section key ?default?
Returns the value of the named key and section. If specified, the default value will be returned if the key does not exist. If the
key does not exist and no default is specified an error will be thrown.
::ini::set ini section key value
Sets the value of the key in the specified section. If the section does not exist then a new one is created.
::ini::delete ini section ?key?
Removes the key or the entire section and all its keys. A section is not automatically deleted when it has no remaining keys.
::ini::comment ini section ?key? ?text?
Reads and modifies comments for sections and keys. To write a section comment use an empty string for the key. To remove all com-
ments use an empty string for text. text may consist of a list of lines or one single line. Any embedded newlines in text are prop-
erly handled. Comments may be written to nonexistant sections or keys and will not return an error. Reading a comment from a nonex-
istant section or key will return an empty string.
::ini::commentchar ?char?
Reads and sets the comment character. Lines that begin with this character are treated as comments. When comments are written out
each line is preceded by this character. The default is ;.
BUGS, IDEAS, FEEDBACK
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category inifile
of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for
either package and/or documentation.
CATEGORY
Text processing
inifile 0.2.3 inifile(n)