I am passing a file name as a parameter to shell script
the parameter is getfile.txt.gpg
how do i process this parameter to get name like getfile.txt only and eleminate the .gpg text??
Thanks in advance (2 Replies)
Hi,
I am executing a shell script which takes a string as a parameter.
The scipt should validate the string and create the directoy with the name of specfied string.
The following is the specified command and its parameter.
test.sh "abc abc"
The shell script is not able to identify... (4 Replies)
i got a file called Pass1, and then i need to passed a number to my script with the '-p pass_mark' option.
Example type
Pass1 -p 18
to pass 18 to my script for comparing things, so how can i do it? (7 Replies)
I have written a function that fills an array and another function where if a parameter is supplied it will jump to that part of the array and cat it to the screen.
I need to put in some checks to make sure the parameter supplied is firstly a number and then not a number great than the length of... (2 Replies)
Hello Everyone,
I have been trying to complete a shell script where, I need to increment the date depending on the file (depending on the date) availability on the remote server.
i.e.
Basically, I will be passing a counter (like parameter 1 or 2 or 3 or 4).
First I will check for the... (1 Reply)
this is my issue.
4 parameters are passed from korn shell to sql script.
parameter_1= varchar2 datatype or no value entered my user.
parameter_2= number datatype or no value entered my user.
parameter_3= number datatype or no value entered my user.
parameter_4= number datatype or no... (5 Replies)
Hi
I am looking for a unix command or a small shell script which can takes one parameter and then searches for the passed in the parameter in any or all files under say /home/dev/
Can anyone please help me on this? (3 Replies)
I need to check if the parameters are correctly passed based on the Environment I am in.
For e.g when I am in dev the 1st paramter needs to be either A OR B OR C OR D
similarly when I am in qa the parameter needs to be either e or f
so i need to write a case staement or a if statement to... (1 Reply)
Hi,
I have the following files.
->cat scr.sh
export TMP_DIR=/home/user/folder1
export TMP_DIR_2=/home/user/folder2
while read line
do
cat "$line"
done<file_list.dat
------------------------
-> cat file_list.dat
$TMP_DIR/file1.txt
$TMP_DIR_2/file2.txt
---------------------------
-> cat... (6 Replies)
Discussion started by: barath
6 Replies
LEARN ABOUT PHP
tempnam
TEMPNAM(3) 1 TEMPNAM(3)tempnam - Create file with unique file nameSYNOPSIS
string tempnam (string $dir, string $prefix)
DESCRIPTION
Creates a file with a unique filename, with access permission set to 0600, in the specified directory. If the directory does not exist or
is not writable, tempnam(3) may generate a file in the system's temporary directory, and return the full path to that file, including its
name.
PARAMETERS
o $dir
- The directory where the temporary filename will be created.
o $prefix
- The prefix of the generated temporary filename.
Note
Windows uses only the first three characters of prefix.
RETURN VALUES
Returns the new temporary filename (with path), or FALSE on failure.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 4.0.3 | |
| | |
| | This function's behavior changed in 4.0.3. The |
| | temporary file is also created to avoid a race |
| | condition where the file might appear in the |
| | filesystem between the time the string was gener- |
| | ated and before the script gets around to creat- |
| | ing the file. Note, that you need to remove the |
| | file in case you need it no more, it is not done |
| | automatically. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
tempnam(3) example
<?php
$tmpfname = tempnam("/tmp", "FOO");
$handle = fopen($tmpfname, "w");
fwrite($handle, "writing to tempfile");
fclose($handle);
// do here something
unlink($tmpfname);
?>
NOTES
Note
If PHP cannot create a file in the specified $dir parameter, it falls back on the system default. On NTFS this also happens if the
specified $dir contains more than 65534 files.
SEE ALSO tmpfile(3), sys_get_temp_dir(3), unlink(3).
PHP Documentation Group TEMPNAM(3)