11-06-2014
We use C Shell atm. Here is more clear information C shell script print information about filespace objects.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Rather new to unix, so please don't beat me!
I'm trying to get a list of files into a variable that I can use throughout the rest of the script. The challenge is that I need to exclude a certain extension from the list, and I'm having trouble with it. For example:
item_a
item_a.exe... (3 Replies)
Discussion started by: Loriel
3 Replies
2. Shell Programming and Scripting
hey,
im looking for a way of extending a string in shell script.
for example i have two strings "." and "abcd",
i need to extend the first string so that it is the same length as the second.
so "." and "abcd" becomes "...." and "abcd",
could someone shed light on how to do this ? thanks (4 Replies)
Discussion started by: vbm
4 Replies
3. Shell Programming and Scripting
Hey,
I'm having a problem finding out if a directory holds any files with a certain file extension, for example .txt.
I have tried: if (! -e "*.txt")
and I've tried: set FILES=`ls *`
echo "Found $FILES"
foreach FILE ($FILES)
if($FILE == "*.txt")
And neither of... (2 Replies)
Discussion started by: amnesiaiom
2 Replies
4. Shell Programming and Scripting
Hi All
I have a csh shell script which should check if a given file is a zip file as below:
****************************************
#!/bin/csh -f
if ]; then
echo is a zip file
else
echo sorry not a zip file
endif
exit
****************************************
... (1 Reply)
Discussion started by: raj144
1 Replies
5. UNIX for Dummies Questions & Answers
I searched the forum, but there was different type of rename.
Hello.
I have files in folder.
Like:
xxxxxxxx1.html
or
xxxxxxxx2.txt
or
xxxxxxxx3.tar.gz
and how to rename or change file extension case to
xxxxxxxx1.htm
or
xxxxxxx2.TXT
or (5 Replies)
Discussion started by: Sheldon
5 Replies
6. Shell Programming and Scripting
Hi.,
How to extract the extension of a file which are present in the directory?. In my script I tried something like:
echo abc_ss_222_54.txt | awk -F"" '{print $5}'
But I din't got .txt echoed in console. Pl. suggest a solution for this.
And also, for finding a specific... (1 Reply)
Discussion started by: IND123
1 Replies
7. Red Hat
Hell Guys,
Being a newbie, I need some help in finding a certain string from a log file of thousands of lines (around 30K lines) and have the output in a separate file.
Below is the file output -
10.155.65.5 - - "POST... (15 Replies)
Discussion started by: rockf1bull
15 Replies
8. Shell Programming and Scripting
so I've made a shell script that downloads 6 files in succession from a given url, then deletes them. Now I want to time the script, and the average time it uses by running it ~100 times. My problem is tho, how do I store the time it takes for each run through of the script? I know time writes to... (3 Replies)
Discussion started by: navlelo
3 Replies
9. Shell Programming and Scripting
I have a directory that contains several files, out of which some files are have an extra extension for example
file1.new.new.new
file2.new.new.new
file3.new.new.new
file4.new.new.new
i want to write a shell script that rename all such file with only single extension like
file1.new... (7 Replies)
Discussion started by: mukulverma2408
7 Replies
10. Shell Programming and Scripting
Hello,
I have a shell script like the one below but cannot get it working:
#!/bin/bash
#$ -cwd
CHR=$2
# directories
ROOT_DIR=./
RESULTS_DIR=${ROOT_DIR}results/
# executable
SHAPEIT_EXEC=${ROOT_DIR}shapeit.v2.r727.linux.x64/shapeit.v2.r727.linux.x64
# parameters
THREAT=5... (1 Reply)
Discussion started by: wmelroy
1 Replies
LEARN ABOUT PHP
ziparchive.addglob
ZIPARCHIVE.ADDGLOB(3) 1 ZIPARCHIVE.ADDGLOB(3)
ZipArchive::addGlob - Add files from a directory by glob pattern
SYNOPSIS
bool ZipArchive::addGlob (string $pattern, [int $flags], [array $options = array()])
DESCRIPTION
Add files from a directory which match the glob $pattern.
PARAMETERS
o $pattern
- A glob(3) pattern against which files will be matched.
o $flags
- A bit mask of glob() flags.
o $options
- An associative array of options. Available options are:
o "add_path" Prefix to prepend when translating to the local path of the file within the archive. This is applied after any
remove operations defined by the "remove_path" or "remove_all_path" options.
o "remove_path" Prefix to remove from matching file paths before adding to the archive.
o "remove_all_path" TRUE to use the file name only and add to the root of the archive.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
ZipArchive::addGlob example
Add all php scripts and text files from current working directory
<?php
$zip = new ZipArchive();
$ret = $zip->open('application.zip', ZipArchive::OVERWRITE);
if ($ret !== TRUE) {
printf('Failed with code %d', $ret);
} else {
$options = array('add_path' => 'sources/', 'remove_all_path' => TRUE);
$zip->addGlob('*.{php,txt}', GLOB_BRACE, $options);
$zip->close();
}
?>
SEE ALSO
ZipArchive::addFile, ZipArchive::addPattern.
PHP Documentation Group ZIPARCHIVE.ADDGLOB(3)