10-14-2010
I tried running the script with -x option and got the below message.
ksh -x script.ksh
+ [ -e /path/filename1.20101001_18_18_40.tar.gz /path/filename1.20100930_18_18_40.tar.gz /path/filename1.20101002_18_18_40.tar.gz ]
script.ksh[3]: [: /path/filename1.20100930_18_18_40.tar.gz: unexpected operator/operand
So it's becuase of its finding multiple files
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I'm sure this can't be too tough, but.
I want to check the existance of file(s) by extension. There may be 0,1,N files. If any files exist, then remove them.
Thanks for any insight. (3 Replies)
Discussion started by: niswonp
3 Replies
2. Shell Programming and Scripting
I have a list of files and their directories, starting from a particular location. e.g.
temp/new/a.c
temp/new/b.c
temp/old/a.c
temp/old/older/b.c
etc.
Now I want to check the existence of all these files in the respective directories .
I am trying something like
cat "fileList" |... (4 Replies)
Discussion started by: herojeett
4 Replies
3. Shell Programming and Scripting
Hi all,
I have the following code:
if ; then echo 'folder not exist'; else echo 'folder exist'; fi
The "testing" folder is not exist in /home/batch , but thhe result is 'folder exist'. It seems that the code cannot detect that the folder "testing" not exist.
ANybody know the... (1 Reply)
Discussion started by: suigion
1 Replies
4. Shell Programming and Scripting
Hi,
I would like to check whether all the directories exists or not. I tried the below but it gives some error. below is the excerpt from my original script
24 #Check if the required directories are exists
25 dirExists() {
26
27 if
28 then
29 echo "required... (1 Reply)
Discussion started by: lookinginfo
1 Replies
5. Shell Programming and Scripting
Kindly help on below script:
<<
i='find ...'
if then
echo 'File Exists'
else
echo 'File Does Not Exist'
>>
If i has some file name then it runs properly but if i has nothing ( blank value) then it throws an error. I dont exactly remember right now but error seems like:... (2 Replies)
Discussion started by: ravigupta2u
2 Replies
6. Shell Programming and Scripting
Hi Friends,
I wrote one shell script to check the record count in two files and that will send us the notification activity if found zero record count.
What i did is I created for loop and checking the count for both of the files but what is happening is for first file has data then it's... (13 Replies)
Discussion started by: victory
13 Replies
7. Shell Programming and Scripting
HI Guys,
I have some 8 files with different name and extensions. I need to check if they are present in a specific folder or not and also want that script to show me which all are not present. I can write if condition for each file but from a developer perspective , i feel that is not a good... (3 Replies)
Discussion started by: shankarpanda003
3 Replies
8. Shell Programming and Scripting
Hello,
I have a file with below content - Example
3
6
69
139
210
345
395
418
490
492
I would like the result as - Multiple of 70 or nearest number in the file less than the multiple of 70
69
139 (5 Replies)
Discussion started by: Mannu2525
5 Replies
9. Shell Programming and Scripting
Hello,
For our work we use several scripts to gather/combine data for use in our webshop. Untill now we did not had any problems but since a couple days we noticed some mismatches between imports.
It happened that several barcodes where matched even though it was a complete other product. Of... (19 Replies)
Discussion started by: SDohmen
19 Replies
10. Shell Programming and Scripting
Hello,
I have 40 data files where the first three columns are the same (in theory) and the 4th column is different. Here is an example of three files,
file 2: A_f0_r179_pred.txt
Id Group Name E0
1 V N(,)'1 0.2904
2 V N(,)'2 0.3180
3 V N(,)'3 0.3277
4 V N(,)'4 0.3675
5 V N(,)'5 0.3456
... (8 Replies)
Discussion started by: LMHmedchem
8 Replies
is(n) [incr Tcl] is(n)
__________________________________________________________________________________________________________________________________________________
NAME
is - test argument to see if it is a class or an object
SYNOPSIS
itcl::is option ?arg arg ...?
_________________________________________________________________
DESCRIPTION
The is command is used to check if the argument given is a class or an object; depending on the option given. If the argument if a class or
object, then 1 is returned. Otherwise, 0 is returned. The is command also recognizes the commands wrapped in the itcl code command.
The option argument determines what action is carried out by the command. The legal options (which may be abbreviated) are:
is class command
Returns 1 if command is a class, and returns 0 otherwise.
The fully qualified name of the class needs to be given as the command argument. So, if a class resides in a namespace, then the
namespace needs to be specified as well. So, if a class C resides in a namespace N, then the command should be called like:
is N::C
or
is ::N::C
is object ?-class className? command
Returns 1 if command is an object, and returns 0 otherwise.
If the optional "-class" parameter is specified, then the command will be checked within the context of the class given. Note that
className has to exist. If not, then an error will be given. So, if className is uncertain to be a class, then the programmer will
need to check it's existance beforehand, or wrap it in a catch statement.
So, if c is an object in the class C, in namespace N then these are the possibilities (all return 1):
set obj [N::C c]
itcl::is object N::c
itcl::is object c
itcl::is object $obj
itcl::is object [itcl::code c]
KEYWORDS
class, object
itcl 3.3 is(n)