I found this command, sed -e 's/<[^>]*>//g', will return the content of a line with pattern something like this, <tag1>content</tag1>..
How does this works?
What does sed -e 's/<[^>]*>//g' actually do?
What if I wanted to get content of a line with pattern something like this, [tag2]content[/tag2]?
thanks..
The first sentence removes all the tags so the content remains.
To do the same with [] you could do this:
This User Gave Thanks to Scrutinizer For This Post:
Hi folks,
Our application installation uses "sed" command to append string after specific line or after line number.
Both cases work perfect on Linux but fail on Solaris.
The OS versions are Solaris 9 and Linux Red Hat AS 3.
i.g:
Linux:
-----
file foo.txt
aaa
bbb
ccc
ddd
root#... (4 Replies)
Hi all,
Our application installation uses "sed" command to delete rest of line. It work perfect on Linux but fail on Solaris.
The OS versions are Solaris 9 and Linux Red Hat AS 3.
yourfile.txt
hello and world
cat and dog
hello world
in linux:
cat yourfile.txt | sed ‘s/\(\+\)... (3 Replies)
Hi all .... vexing problem here ...
I am using sed to replace some special characters in a .txt file:
sed -e 's/_<ED>_/_355_/g;s/_<F3>_/_363_/g;s/_<E1>_/_341_/g' filename.txt
This command replaces <ED> with í , <F3> with ó and <E1> with á.
When I run the command to standard output, it works... (1 Reply)
Hi,
I use this command in Linux but if I run the same command does not work in freebsd.
Follow the below command:
Linux works:
sed -e '1731a\' -e '####' squid.conf > squid2.conf ; sed -e '1731a\' -e 'acl TESTE_ip src 192.168.1.1/255.255.255.255' squid2.conf > squid.conf ; sed -e... (7 Replies)
Hi, I have a question.
I define a function using sed command:
replace()
{
searchterm=$1
replaceterm=$2
sed -e "s/$searchterm/$replaceterm/ig" $3 > $WORK'tempfile.tmp'
mv $WORK'tempfile.tmp' $3
}
Then I call
replace 'test = 0' 'test = 1' $myfileThis code works well in... (1 Reply)
Hi, I have a question.
I define a function using sed command:
replace()
{
searchterm=$1
replaceterm=$2
sed -e "s/$searchterm/$replaceterm/ig" $3 > $WORK'tempfile.tmp'
mv $WORK'tempfile.tmp' $3
}
Then I call
replace 'test = 0' 'test = 1' $myfile
This code... (1 Reply)
Hi,
I have a problem with a SED script that works fine on AIX but does not work properly on a Solaris system.
The ksh script executes the SED and puts the output in HTML in tables.
But the layout of the output in HTML is not shown correctly(no tables, no color). Can anyone tell if there is... (7 Replies)
The following command works perfectly in Terminal, but not in Applescript. (Returns "unknown token" error for square brackets.)
(new to site. sorry.)
I have an Applescript that is designed to find and remove any square-bracketed text, including the square brackets.
I ran the following code from... (1 Reply)
Hi,
I am a bit confused ,why would a sed command work fine outside of ksh script but not inside.
e.g
I want to replace all the characters which end with a value and have space at end of it.
so my command for it is :
sed -i "s/$SEPARATOR /$SEPARATOR/g" file_name
This is working fine in... (8 Replies)
Hi,
On Linux i get the desired ouput:
echo "<value>WEB_USER</value>" | sed 's/\(<value>\|<\/value>\)//g'Output:
Executing the same command on Solaris:
echo "<value>WEB_USER</value>" | sed 's/\(<value>\|<\/value>\)//g'Output:
I need to get the desired output on Solaris i.e. WEB_USER and... (4 Replies)
Discussion started by: mohtashims
4 Replies
LEARN ABOUT PHP
imap_listscan
IMAP_LISTSCAN(3) 1 IMAP_LISTSCAN(3)imap_listscan - Returns the list of mailboxes that matches the given textSYNOPSIS
array imap_listscan (resource $imap_stream, string $ref, string $pattern, string $content)
DESCRIPTION
Returns an array containing the names of the mailboxes that have $content in the text of the mailbox.
This function is similar to imap_listmailbox(3), but it will additionally check for the presence of the string $content inside the mailbox
data.
PARAMETERS
o $
imap_stream -An IMAP stream returned by imap_open(3).
o $ref
-$ref should normally be just the server specification as described in imap_open(3)
o $pattern
-Specifies where in the mailbox hierarchy to start searching.There are two special characters you can pass as part of the $pat-
tern: ' *' and ' %'. ' *' means to return all mailboxes. If you pass $pattern as ' *', you will get a list of the entire mailbox
hierarchy. ' %' means to return the current level only. ' %' as the $pattern parameter will return only the top level mailboxes; '
~/mail/%' on UW_IMAPD will return every mailbox in the ~/mail directory, but none in subfolders of that directory.
o $content
- The searched string
RETURN VALUES
Returns an array containing the names of the mailboxes that have $content in the text of the mailbox.
SEE ALSO imap_listmailbox(3), imap_search(3).
PHP Documentation Group IMAP_LISTSCAN(3)