im working on an assignment (airline ticketing system). im kinda having problems with the search function. i want users to be able to search by departure time or by flight. however, my output displays the whole chunk of data instead of what they are supposedly searching for. appreciate if anyone could guide me on how to rectify it using grep. im currently using awk. thanks in advance.
here are my codes:
and this is my airlines.txt file.
0600 - 01Jan, SIA
1000 - 01Jan, Cathay Pacific
0830 - 03Jan, SIA
1100 - 03Jan, Qantas Air
0830 - 03Jan, China Air
1200 - 03Jan, SIA
i'm a grad student taking a UNIX course and a networks course (i have a background in C++ and JAVA). i'm trying to combine the two classes.
My questions stems from a networks programming homework assignment below:
"Using the operating system and language of your choice, develop a program to... (5 Replies)
Hello,
I am just a new comer in this forum, looking for help in Shell Programming in Linux, bash/csh/ash!
Is there anyone who do can help so far, then, I will be grateful very very much (2 Replies)
Hi all,
I am trying to figure out a way to write a cprg that masks SIG_PIPE & SIG_ABRT signals,check if they are pending , if they are pending unmask and service them.
But so far i have no luck!!!
Could you please let me know how to write it?
Thanks (3 Replies)
Hi all,
I am a newbie to unix programming using C..
So i would like to have a few simple C programs to start off with..
I wanted programs on learning ,
abort,kill and raise,alarm and pause,I would also like to know how to use the vfork() in a prg
It would be really great if i can have... (1 Reply)
Good evening everyone! :)
I'm doing a small client / server application for sharing files in C, and I am trying to implement the following:
The client of my application sends to the address 255.255.255.255 a message requesting a particular file.In the network there is only one server,... (1 Reply)
Hello All,
I have another Korn shell question. I am writing a script that will ftp a file from my production database to my test database.
To this, I have to construct a loop that checks a specified folder for a file.
If the file exists, I want it execute the ftp protocol and then exit. ... (2 Replies)
Hello,
I am just a beginner in Awk, and I use it occasionally, to manipulate large data files. I have faced with the following problem.
I have a file with a several thousands columns. It has a header, and then row after row of numerical data, except the first column, which contains symbols.... (3 Replies)
Hi,
I am novice in PERL enviornment. I have a text files withso many entries in rows and columns. I have to pick up entries
named as "Uniprot ID" in the file and create a new text file with list of particular Uniprot ID entries. Can anybody guide regarding this.. I came to know abut fgrep... (1 Reply)
Hi Everyone,
I need some help in some data extraction that I need to perform.
I have a file with about 91000 lines. Among those lines, there are lines like the following, which are scattered among many other information:
==================
$V1
$V1$mb
"V862" "V1052" "V1388" "V1876"... (7 Replies)
Hi all,
I have written a wrapper script in Perl which will be used on AIX, Linux and Windows and I do not want to change any code for the needs for a specific OS if avoidable.
It works fine so far on all 3 OSes, not blowing up any stacks any more, but I am unsure how to handle writing log files... (7 Replies)
Discussion started by: zaxxon
7 Replies
LEARN ABOUT PHP
touch
TOUCH(3) 1 TOUCH(3)touch - Sets access and modification time of fileSYNOPSIS
bool touch (string $filename, [int $time = time()], [int $atime])
DESCRIPTION
Attempts to set the access and modification times of the file named in the $filename parameter to the value given in $time. Note that the
access time is always modified, regardless of the number of parameters.
If the file does not exist, it will be created.
PARAMETERS
o $filename
- The name of the file being touched.
o $time
- The touch time. If $time is not supplied, the current system time is used.
o $atime
- If present, the access time of the given filename is set to the value of $atime. Otherwise, it is set to the value passed to the
$time parameter. If neither are present, the current system time is used.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.3.0 | |
| | |
| | It became possible to change the modification |
| | time of a directory under Windows. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
touch(3) example
<?php
if (touch($filename)) {
echo $filename . ' modification time has been changed to present time';
} else {
echo 'Sorry, could not change modification time of ' . $filename;
}
?>
Example #2
touch(3) using the $time parameter
<?php
// This is the touch time, we'll set it to one hour in the past.
$time = time() - 3600;
// Touch the file
if (!touch('some_file.txt', $time)) {
echo 'Whoops, something went wrong...';
} else {
echo 'Touched file with success';
}
?>
NOTES
Note
Note that time resolution may differ from one file system to another.
Warning
Prior to PHP 5.3.0 it was not possible to change the modification time of a directory with this function under Windows.
PHP Documentation Group TOUCH(3)