CentOS 5 :: Retrieve Special Character From A String?
May 18, 2011
Operating System: CentOS 5.4 I have a bash script that runs another php script to return a decrypted password. The return value is right but when I concatenate it with another string, I would not have the whole string. To better understand the problem, here is my script:
***********************************************************************************
#!/bin/bash
getProperty()
[code].....
View 1 Replies
ADVERTISEMENT
Apr 11, 2011
I want to match some filename in some text, but the filenames I have no control of, so "[" can "]" can appear in the filenames.so do I always have to use sed to addslashes to these variables before I have to grep them? and what other characters have I missed other than "[", "]", "."?
View 4 Replies
View Related
Mar 27, 2010
1.What character instructd the shell to interpret a special character as an ordinary character?
2.What directory contains some of the utilities available on the system in the form of binary files?
3. What command is used to search the location of a utility?
4. What command is used to instruct the editor to write the file and quit the editor?
5. What key quits the more utility and displays the shell prompt?
6. What command starts a child shell as the super user, taking on root's identity and environment?
7. Which wildcard characters can be used for searching all the files in the system that start with "A"?
8. The user name or login name of the super user is????
[Code]....
View 10 Replies
View Related
Mar 12, 2011
I need a script that will replace '/' in a variable with ''I have tried the following:
Code:
y=$(echo $1|sed 's///\/g')
The thing is that this approach does not always work. Here is an example:
Code:
user@pc:~$ sh script.sh /usr/var/sakis.txt
z:usr
arsakis.txt
user@pc:~$ sh script.sh /usr/tar/sakis.txt
z:usr arsakis.txt
Is there a way to treat those characters?
View 3 Replies
View Related
Nov 3, 2010
we have Centos linux and database postgresql and taking dump in .data files. need to find all speical character in my database dump .data files it is open in txt paid and store in one txt file. e.g of special character are as below.
[Code]....
View 1 Replies
View Related
Feb 27, 2009
I have two systems at hand. One a Debian box, the other a RHEL5 box. On the Debian box there is a MySQL server (5.0.32-Debian_7etch1) running which hosts Databases from a customized content management system. This system has grown over time and the tables are stored with different collations. Now I want to export and reimport the data on the RHEL5 MysQL server (5.0.45).
And here the special character hell begins. It doesn't matter if I reimport the data as utf8, as latin1 or latin1_swedish_ci. Everytime the special characters are wrong and distorted. Surprisingly the data that is shipped with the unmodified CMS displays the special chars correctly after installation. But I have to import the modified version from the old server as there are lots of modifications to import.
Old server:
Quote:
character set client utf8
(Global value) latin1
character set connection utf8
[code]....
New server:
Quote:
character set client utf8
(Global value) latin1
character set connection utf8
[code]....
View 1 Replies
View Related
Jan 30, 2011
I am reading strings from a file using readline() function,the file contains some strings which has only special characters, I need to avoid the strings which has only special characters, the special characters are not similar. How to do it in python.??
View 2 Replies
View Related
Apr 29, 2011
I am having difficulty getting sed to replace a string of text in an XML file, despite the fact that I have no trouble using grep to find that same string. Since the new string and old string to be replaced contain a lot of special characters, I thought it best to store them in variables as opposed to using a slew of backslashes:
OLD_STRING='<property name="webServiceHost">${jboss.bind.address}</property>'
NEW_STRING='<!--<property name="webServiceHost">${jboss.bind.address}</property>-->'
[Code]....
View 2 Replies
View Related
Aug 26, 2009
Below is extract of my file:
What I need is to replace "--destination-path=" with "--destination-path=/home/dest"
i.e. desired output is ----destination-path=/home/dest
I could achieve it with below command
$cat outgoing-xfer|grep destination-path|perl -pi -e "s/destination-path=/destination-path=/home/dest/g"
But the problem is that in this case i just wanted to append "/home/dest" for which I could easily escape "/" with just two "", but I wonder if i have a long path like "/a/b/c/d/e/f/g/h/i/j" I will have to escape so many /. Is there any other way by which I can avoid escaping forward slash.
I tried following:
But receiving follo error
Bareword found where operator expected at -e line 1, near "s/destination-path=/'destination-path=/home"
syntax error at -e line 1, near "s/destination-path=/'destination-path=/home"
Bad name after dest' at -e line 1. tried with enclosing in double quotes as well but in vain
View 5 Replies
View Related
Oct 23, 2010
i am compiling the following program in linux. it's in c language. after the compilation with gcc when i run the executable file. it asks for input. but when i enter a name. i prints "Segmentation fault" and then terminate the program. can you please help me.
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <unistd.h>
[code]....
View 1 Replies
View Related
Jan 19, 2011
how to replace last character string. For example
$>export T1=abcde
$>export T2=xyz
how to get result abcdxyz?
View 10 Replies
View Related
Dec 1, 2010
How can I search "$" in vim, which is not the end of line but the real char '$'.
View 1 Replies
View Related
May 18, 2010
Like the following c++ program, I define a pointer of char type in the class named "test". In the function init1(), str="hello1" , what is the existing period of "hello1". Whether the string "hello1" will be invalid if the function init1() exits ? then "str" point to the invalid field in memory. When will "hello1" and "hello2" be released by OS ?
Where is "hello1" stored in memory?
Code:
When will "hello everyone" be released?
View 1 Replies
View Related
Aug 18, 2010
i have problem in java. how to convert string array to character. e.g string a[]={"ab","abc","abd","ag"}; what will be the character array ?
View 3 Replies
View Related
Oct 20, 2010
I have a folder of MP3s, where some have <artist>- <song> and others have <artist> - <song>. I wanted to make all of them say <artist> - <song>
The command that works for me was
for i in *[a-Z]-*; do mv "$i" "`echo $i | sed 's/-/ -/g'`"; done
but if I -hadn't- used ls with my parameters to filter out the valid results, how would I have done this with sed? I got close with:
ls | sed -e 's/(.*)[a-Z]-(.*)/1 - 2/'
but with the above I lose the [a-Z] character that I used to match with (and I need to keep that).
View 4 Replies
View Related
Oct 1, 2010
I'm trying to retrieve a single string or value from /proc/cpuinfo, but when I try to extract the model (not the model name) the model name comes with it, also it likes to print it twice...
Code:
model="`cat /proc/cpuinfo | grep model | cut -d: -f2 | cut -c1-3`"
echo $model
All i want this to do is spit out the model number once. (I need to pass it to another script)
View 14 Replies
View Related
Apr 29, 2010
I have to enhance the behaviour of a backup script written in perl. I don't need to change it, what I need to do is to create a bash script that does some checks like file name and file size, execute the backup script then check if the backup files match the original files.Here's how I try to do it:
- read the files from the original files folder
- store them in an array
- search in the array the files that have a specific file extension
- store the file names that match the search pattern (I know the backup script skips some files so I can hardcode the search pattern)
- run the backup script
- read the files from the backup folder
- store them in an array
- compare the original files name and size stored in an array with those from the backup folder
- send a report email
View 3 Replies
View Related
May 4, 2009
Inside a loop i'm populating a string variable. Because csh doesn't have very good support for arrays I thought of doing this. I want to add a new line character to the end of the concatenation each time the loop iterates. Then at the end print this variable out.
I tried " and some resources said it was just a "". Neither work. What am I doing wrong?
View 1 Replies
View Related
Jul 16, 2010
I have a large text file that's formatted sort of like this:
Code:
foo bar
blah
[code]...
View 2 Replies
View Related
Mar 30, 2010
I want to use SED to do the following: In a text file replace any occurrences of the three character string ZZZ with a quotation mark "and. replace all occurrences of a comma with a semi-colon. It is the S/ / / command which is stumping me on the first issue...inparticular how to get the replace string to be quote.
View 9 Replies
View Related
Apr 21, 2010
I have searched and searched in regards to this documented 'special expression '-l STRING' for the 'test' command, and to no avail, have I found out why it does not work on my system.
The example always given is:
Code:
test -l abc -gt 1 && echo yes
And the returned result is:
Code:
bash: test: -l: unary operator expected
The documention is usually as follows:
Numeric tests
Numeric relationals. The arguments must be entirely numeric (possibly negative), or the special expression `-l STRING', which evaluates to the length of STRING. Then examples are given, including the one I provided above. Does anyone else have this issue of getting an error when trying this special expression of 'l STRING' ???
View 4 Replies
View Related
May 7, 2011
How to grep a string like "ab?c12345678" where 3rd character is unknown, while other characters are known.
View 2 Replies
View Related
Apr 2, 2009
I am trying to install 5.3 using net install disc, where it hangs for over 30 minutes trying to retrieve stage2.img. Second time. After first time and waiting over 25 minutes, I tried Debian net install on another box, and it's done with installation long ago, while this one is still hanging (and from the looks of it I doubt it will continue).
1. Network is good, the box pings, network parameters are good, Debian worked flawlessly with same parameters
2. It did pull all it needed before stage2.img
3. Plenty of RAM in the box, over 3 GB
4. The box needs no additional drivers (except newer version of kernel as vanilla still doesn't have a complete support for Intel DP43TF board), distro has them all
View 1 Replies
View Related
Oct 22, 2010
copy string a to string b and change string b with toupper() and count the chars
View 3 Replies
View Related
Jul 28, 2009
i am sort of a n00b at *nix, and i wanted to install KSB26 on my centos 5.3 install.I downloaded the file. and extracted it.I modified the install.sh in the file to point to /usr/src/kernels/.I run the installation, but it shows many errors telling me to run make oldconfig and make prepare on the src.I run that but i still get the same error and installtion does not occur.Do i need any special packages installed?
View 3 Replies
View Related
Mar 4, 2010
I have to create an unattended install from an USB with special instructions. Unfortunately I'm a newbie and I have no clue as to where to start. We did recieve one link to use and I still don't understand what I'm supposed to do. The link is on the CentOS home page.
View 1 Replies
View Related
Mar 21, 2011
I made a duplicate of a Centos 5.5 system disk with dump (dd if=/dev/sda of=/dev/sdb). No device files for sdb were created, but I guess that's not too surprising. I rebooted, and the device files were created. But how would I create them if I wanted to avoid the reboot?
I looked around for info on mknod and MAKEDEV but didn't find a lot.
View 4 Replies
View Related
Sep 8, 2010
I'm trying to figure out how to retrieve SNORT from a repository and I'm stuck. How can I find the latest version and install it?
View 4 Replies
View Related
Jun 25, 2009
I have centos 5, and apache. I've recently had to make a website in Polish, which has some characters that do not seem to be supported on Centos. Is there a way to install more character sets?
View 3 Replies
View Related
Aug 9, 2010
Unable to add user name which contains more than 30 character in Centos 5.4. how to add user more than 30 character.
View 2 Replies
View Related