that $file_name variable won't take the latest value assigned to the $cv?
This is correct. and the filename will take the latest value.
(only of those which are assigned before defining filename variable.)
if you assign a new value to CV after filename then filename is unaffected (clear though!).
$file will still contain the a_2 ( cv=2).
shell reads the commands one by one.. top to bottom.
moreover, not sure which shell you are using.. but i can see lots of syntax errors and improvement in your code as par my knowledge.
Hi,
I am working on device drivers.Once If register a device i'll get one major no. If i unregister and register again i'll get a different major no.What i have to do to get same major no. each time :( (0 Replies)
Hello, I have 2 hp-ux both running 11.23, I have move one of a harddisk from "UNIX A" to "UNIX B", so how can I read back the data in "UNIX B"?
Thanks (5 Replies)
I'm currently using zsh. Sometimes I find myself wishing to reuse an argument from earlier in the command.
I know that I can, of course, assign an argument to a variable ahead of time, and then easily use that variable more than once.
I know about the ability to reuse arguments from previous... (0 Replies)
Hello everyone.
I'm trying to create a conf file with variables that my other scripts will use.
I have several scripts that use the same variables, and since I don't know how to read them from an external file, i define them in each script (and then if i want to change one's value i need to... (4 Replies)
I have a LUN (From HP-Storage VA7110) that is claimed on 2 servers, but is in used in one of the VG on Server-1 .
Now I want to shut Server-1 and re-use that LUN on server-2 .
Server-1
Path-1 : /dev/rdsk/c4t0d1
Path-2: /dev/rdsk/c6t0d1
Server-2
Path-1: /dev/rdsk/c5t0d1
Path-2:... (8 Replies)
Hi
I am trying to write a shell script and wanted to re-use the value which I have entered already.
Here is the sample code.
echo "Enter Value : \c" ; read val
echo "Enter number: $val\c" ; read num
Now I wanted to change the value as showing in 2nd Line or if I will use enter, it... (15 Replies)
Greetings.
First of all I consider myself a newbe in Linux, that's why I'm seeking your help so please be patient!
I was given an old server (Solaris) that has Oracle (10.2.0) installed with a few databases. I'm supposed to reuse this server for this new application which will process data... (11 Replies)
I have a collection of format strings for sscanf, such as
"%02d%*1s%02d%*1s%02d"
to read in certain formatted strings, such as dates, times, etc.
I wonder if there is a way to use them in printf without some changes? The example above would not work - at least I can't think of any ways to... (4 Replies)
Discussion started by: migurus
4 Replies
LEARN ABOUT PHP
finfo_file
FINFO_FILE(3) 1 FINFO_FILE(3)finfo_file - Return information about a file
Procedural style
SYNOPSIS
string finfo_file NULL NULL (resource $finfo, string $file_name, [int $options = FILEINFO_NONE], [resource $context])
DESCRIPTION
Object oriented style string finfo::file NULL NULL (string $file_name, [int $options = FILEINFO_NONE], [resource $context])
This function is used to get information about a file.
PARAMETERS
o $finfo
- Fileinfo resource returned by finfo_open(3).
o $file_name
- Name of a file to be checked.
o $options
- One or disjunction of more Fileinfo constants.
o $context
- For a description of contexts, refer to "Stream Functions".
RETURN VALUES
Returns a textual description of the contents of the $file_name argument, or FALSE if an error occurred.
EXAMPLES
Example #1
A finfo_file(3) example
<?php
$finfo = finfo_open(FILEINFO_MIME_TYPE); // return mime type ala mimetype extension
foreach (glob("*") as $filename) {
echo finfo_file($finfo, $filename) . "
";
}
finfo_close($finfo);
?>
The above example will output something similar to:
text/html
image/gif
application/vnd.ms-excel
SEE ALSO finfo_buffer(3).
PHP Documentation Group FINFO_FILE(3)