Hi all,
is it possible to create a 'dynamic' case statement.
ie
select option in `ls`
do
case satement depending on results of the above `ls`
done
I hope I have explained this ok!
Thanks
Helen (1 Reply)
Can anyone please tell me why this wont work! Thanks so much!
#!/bin/sh
for file
do
case $file in
*.*.*)
echo Cannot have more than 1 dot
exit
;;
*'**'*)
echo Cannot have more than 1 asterisk
exit
;;
*'*'*|?.)
echo this is a target (19 Replies)
hi all
i'm writing a script and in it i need to prompt the user if the entered value is correct or not ,i wrote the following and its not working ,its executing the script even if i enter Y/N
pls any help is appreciated
echo "\nAre you sure you entered the right Destination Environment? y :... (5 Replies)
I want to write a program with the following variables:
a=7000
b=24000
c=613.8
The user can enter two words: Vivid or Blue for example. The challenge is that the user might not want to write the words the way they appear. The user can write V or v or vivid or Vivid or write Blue or blue, or B,... (1 Reply)
Hi all,
I think i'm asking a sqtupid question here..
i'm using case sttament, what is the syntax or symbol for "or"?
I thought was ||
here a quick sample of my case statment
echo "Would you like to update your detail ?"
read response
case $response in
... (2 Replies)
I am writing a script to pull diskspace information from our servers. Here is the script that I wrote:
#!/bin/ksh
for host in `cat /oper/hosts/esc.misc`
do
ssh -q -o ConnectTimeout=10 operator@$host df -h|grep "/dev/" |egrep '8%|9%|100%' | awk '{print H " " "at " $5 " with " $4 "... (1 Reply)
Hi,
I am writing case statement to execute some finction, my requirement is once one of the case statement is executed again it has to prompt for the option.
for script in `echo "$Script_Selected"`
do
case $script in
1) getNoOFActUsers
;;
2) moveServerrOORotation
;;
... (2 Replies)
Hey, guys I really need some help with a project.
"Write a shell program that examines the command line arguments, counts and collects the number of options. Basically it has to collect and count the arguments that start with a "-" and the one's that don't start with a -
I know I have to use... (2 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Hey, guys I really need some help with a project.
"Write a shell program that examines the command line... (8 Replies)
Hi I am new to shell scripting, I wanted to make a shell script that has a case statement asking the user to select their city 1)london 2)tokyo 3) etc., I then want the users input to be stored in a variable and echoed out in another script; so for example if the user selects tokyo, tokyo city code... (2 Replies)
Discussion started by: scriptnewbie
2 Replies
LEARN ABOUT PHP
rar_list
RAR_LIST(3) 1 RAR_LIST(3)RarArchive::getEntries - Get full list of entries from the RAR archive
Object oriented style (method):
SYNOPSIS
public array RarArchive::getEntries (void )
DESCRIPTION
Procedural style:
array rar_list (RarArchive $rarfile)
Get entries list (files and directories) from the RAR archive.
Note
If the archive has entries with the same name, this method, together with RarArchive foreach iteration and array-like access with
numeric indexes, are the only ones to access all the entries (i.e., RarArchive::getEntry and the rar:// wrapper are insufficient).
PARAMETERS
o $rarfile
- A RarArchive object, opened with rar_open(3).
RETURN VALUES rar_list(3) returns array of RarEntry objects or FALSE on failure.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 3.0.0 | |
| | |
| | Support for RAR archives with repeated entry |
| | names is no longer defective. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
Object oriented style
<?php
$rar_arch = RarArchive::open('solid.rar');
if ($rar_arch === FALSE)
die("Could not open RAR archive.");
$rar_entries = $rar_arch->getEntries();
if ($rar_entries === FALSE)
die("Could retrieve entries.");
echo "Found " . count($rar_entries) . " entries.
";
foreach ($rar_entries as $e) {
echo $e;
echo "
";
}
$rar_arch->close();
?>
The above example will output something similar to:
Found 2 entries.
RarEntry for file "tese.txt" (23b93a7a)
RarEntry for file "unrardll.txt" (2ed64b6e)
Example #2
Procedural style
<?php
$rar_arch = rar_open('solid.rar');
if ($rar_arch === FALSE)
die("Could not open RAR archive.");
$rar_entries = rar_list($rar_arch);
if ($rar_entries === FALSE)
die("Could retrieve entries.");
echo "Found " . count($rar_entries) . " entries.
";
foreach ($rar_entries as $e) {
echo $e;
echo "
";
}
rar_close($rar_arch);
?>
SEE ALSO
RarArchive::getEntry, rar:// wrapper.
PHP Documentation Group RAR_LIST(3)