i need to use sed to remove an entire line containing a pattern stored in a variable say $var1
this var1 will be a URL and will therefore contain slashes
any help would be greatly appreciated (1 Reply)
I would like to use sed to replace one occurence of a pattern in a file. When I use the s/// command it replaces all occurences of the pattern in the file. Should I be using something other than sed?
Thanks (6 Replies)
Hi all,
I have a script which uses sed to replace one string with another. The problem is, the string to be matched, and its replacement are coming in as two command line arguments $1 and $2
$1 and $2 can be absolutely anything, but both should be treated purely as strings. My sed command... (1 Reply)
how would you get SED to do the following, say you have the following lines in a text file:
user=tigger
some text some text
some text some text
some text some text
user=ted
some text some text
some text some text
some text some text
user=thekingofrockandroll
you want to find any line... (15 Replies)
Hi
I have a piece of xml that has a pattern like this
<int>159</int><int>30</int>
I want to find this pattern but only substitute the second part of the pattern to {rid1}.
Is that possible in sed ?
Thanks.
---------- Post updated at 12:10 PM ---------- Previous update was at 12:01 PM... (11 Replies)
Hi guys
Following command results in
sed -i 's/#/\\#/g' /home/test/sqlstents*
-bash: /bin/sed: Argument list too long
Please help me solve it.. is there any other way i can do this?.. thanks (4 Replies)
I have a script that needs to read a file with a long list of /path/filenames - replace the name of the server in each file - and write the file to the same path with a date extension. This is the script that I have so far
#!/bin/ksh
umask 022
LIST=`scripts.list`
for i in $LIST
do
... (2 Replies)
Hi all,
I am using GNU sed (named gsed under macports) in OSX. I have a directory with a series of files named pool_01.jpg through pool_78802.jpg. I am trying to use this command to rename the files to their checksum + extension.
md5sum * | gsed -e 's/\(*\) \(.*\(\..*\)\)$/mv -v \2 \1\3/e'
... (3 Replies)
Dear Unix Forums,
I am hoping you can help me with a pattern matching problem.
What am I trying to do?
I want to replace multiple lines of a text file (that match a multi-line pattern) with a single line of text. These patterns can span several lines and do not always have the same number of... (10 Replies)
Hi All,
This question has been asked many times, but my problem is slightly different.
In my shell script i am connecting to oracle database and loading the results to .dat file. This .dat file is later used to create to .xls file Some times the size of .dat file becomes more than 120000... (8 Replies)
Discussion started by: galaxy_rocky
8 Replies
LEARN ABOUT DEBIAN
hook_config_section
hook_config_section(3alleg4) Allegro manual hook_config_section(3alleg4)NAME
hook_config_section - Hooks a configuration file section with custom handlers. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
void hook_config_section(const char *section, int (*intgetter)(const char *name, int def), const char *(*stringgetter)(const char *name,
const char *def), void (*stringsetter)(const char *name, const char *value));
DESCRIPTION
Takes control of the specified config file section, so that your hook functions will be used to manipulate it instead of the normal disk
file access. If both the getter and setter functions are NULL, a currently present hook will be unhooked. Hooked functions have the highest
priority. If a section is hooked, the hook will always be called, so you can also hook a '#' section: even override_config_file() cannot
override a hooked section. Example:
int decode_encrypted_int(const char *name, int def)
{
...
}
const char *decode_encrypted_string(const char *name, const char *def)
{
...
}
void encode_plaintext_string(const char *name, const char *value)
{
...
}
int main(int argc, char *argv[])
{
...
/* Make it harder for users to tinker with the high scores. */
hook_config_section("high_scores", decode_encrypted_int,
decode_encrypted_string, encode_plaintext_string);
...
} END_OF_MAIN()
SEE ALSO config_is_hooked(3alleg4)Allegro version 4.4.2 hook_config_section(3alleg4)