02-13-2009
Zaxxon,
Thanks for the link. Got some idea on it that here some string replacement operation(with longest occurance) is perfomed . But can you tell me how to read this. I mean what is the string in this statement?
a_PROCESS=${0##*/}
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Is there a way to use metacharacters in a loop or in an if.
I want to allow a user to enter Y, y, Yes, yes, Yah, etc...
in a loop I tried:
read response
while *" ]
do........
and
while *" ]
do .........
this works for grep or egrep but not in loops
Why?????? (4 Replies)
Discussion started by: jrdnoland1
4 Replies
2. UNIX for Dummies Questions & Answers
I want to display an asterisk to the screen as part of a string. I know how to use the Backslash to escape it's value. But how do I display it without showing the Backslash? (1 Reply)
Discussion started by: regencyabs
1 Replies
3. Shell Programming and Scripting
Hello,
I have a question, please (I am using tcsh).
I thought that if you enclose something in double quotes, then the shell won't interpret it. For example, when I do:
% echo "ls *"
I get
ls *
However, if I do:
% echo "!l"
I get
echo "ls -F"
ls -F (3 Replies)
Discussion started by: A1977
3 Replies
4. Shell Programming and Scripting
I'm trying to create a bash script that takes a URL as one of its arguments like this:
./script.sh http://url.cfm?asdf&asdf=234
variable=$1
echo $variable
I'm having trouble storing the URL because it contains the meta character "&" which is being interpreted... thus when I run the... (4 Replies)
Discussion started by: kds1398
4 Replies
5. Shell Programming and Scripting
If I have a filename as
filename.txt.20090807
and I use
for FILE in `find . -name "filename*" -type f`
do
my_time=${FILE#./filename.txt.}
I get my output as 20090807
However if my filename is
filename.Y20090807.txt
Is there a way I can use metacharacters in my... (3 Replies)
Discussion started by: RubinPat
3 Replies
6. UNIX for Dummies Questions & Answers
Hello. I am learning how to use Unix through an online course. Unfortunately the text that we use isn't very good, so I could use some help with a pretty basic question.
Use metacharacters and the ll command to list all filenames under the datafiles directory that contain a dot "." with the... (2 Replies)
Discussion started by: feverdream
2 Replies
7. Shell Programming and Scripting
Hi, all.
I have a need to take a flat file FTP'd from Windows to Unix and convert it for loading into a MySQL database without manual intervention. However, some characters are "fancified" (e.g. the fancy Beginning and End double-quotes from Windows) that show up as codes using vi. I need to... (4 Replies)
Discussion started by: superdelic
4 Replies
8. Shell Programming and Scripting
I have prepared a script to submit a string in a txt file.
However there are somethings that I have to check before submitting the string in the txt file.
One of those checks is to determine whether the string entered contains any metacharacters.
I have tried sth like;
echo "string" | grep -v ... (3 Replies)
Discussion started by: ozum
3 Replies
9. UNIX for Dummies Questions & Answers
1) I want to display all the files in a directory that start with the word chapter, are followed by a digit 1,2,6,8, or 9 and end with .eps or .prn
so I came up with this
file ~/temp/chapter.eps ~/temp/chapter.prn
but is there a better way, i.e. combining both file types into the command?
... (2 Replies)
Discussion started by: dunsta
2 Replies
10. Shell Programming and Scripting
I am currently reading a very old reference from O'Reilly: Sed and Awk 2nd Edition reprinted in 2000. So far, it's a solid read and still very relevant. I'd highly recommend this to anyone.
The only problem I have with this book is that I had to resort to bourne shell to get my examples to work... (3 Replies)
Discussion started by: ConcealedKnight
3 Replies
LEARN ABOUT PHP
dbx_escape_string
DBX_ESCAPE_STRING(3) 1 DBX_ESCAPE_STRING(3)
dbx_escape_string - Escape a string so it can safely be used in an sql-statement
SYNOPSIS
string dbx_escape_string (object $link_identifier, string $text)
DESCRIPTION
Escape the given string so that it can safely be used in an sql-statement.
PARAMETERS
o $link_identifier
- The DBX link object returned by dbx_connect(3)
o $text
- The string to escape.
RETURN VALUES
Returns the text, escaped where necessary (such as quotes, backslashes etc). On error, NULL is returned.
EXAMPLES
Example #1
dbx_escape_string(3) example
<?php
$link = dbx_connect(DBX_MYSQL, "localhost", "db", "username", "password")
or die("Could not connect");
$text = dbx_escape_string($link, "It's quoted and backslashed (\).");
$result = dbx_query($link, "insert into tbl (txt) values ('" . $text . "')");
if ($result == 0) {
echo dbx_error($link);
}
dbx_close($link);
?>
SEE ALSO
dbx_query(3).
PHP Documentation Group DBX_ESCAPE_STRING(3)