@OP: Try:
bash is the only shell where the quotes are is necessary in case the file name contains spaces for example..
In any other POSIX shell this should suffice:
or at least:
But
There is a big difference between
and
--
Note:
To expand wildcards you could use a for loop for example..
Then you should be able to use one of the example above with the loop variable..
Last edited by Scrutinizer; 04-06-2013 at 03:37 PM..
Hi,
I'm in the midst of writing a UNIX script that sftp's files to an external host and am stuck with a problem. The problem is that the files created on my server as a order number that correlates to a sequence of directories on the remote host which is where the file should be ftp'ed.
... (3 Replies)
Hi,
I am at a point in my script where I defined the number of the command line parameter I would like to set a variable equal to:
parameter_number=14
I would then like to set a variable equal to the correct parameter:
variable=$parameter_number
The issue here is that {} is required... (2 Replies)
The block below isn't a surprise:$ ls
file1 file2 file3
$ x=*
$ echo $x
file1 file2 file3
$ echo '$x'
$x
$ echo "$x"
*
$But I found this block a bit bewildering:$ echo $x'
>'
*
$I'm wondering why substitution wasn't performed on the $x, since it was unquoted (as far as I can tell).... (5 Replies)
hi guys, i have a question related to quoting but i am not sure how to formulate it...
lets say we want to simulate the following shell actions
cd ~/project-dir
ctags /home/work/folder1/*.sh /home/work/folder2/*.sh /home/work/folder3/*.sh
so i make the following script
buidtags.sh
... (2 Replies)
I can do this on the command line:
sqsh -S 192.168.x.x -o tmp -U user -P fakepass -D horizon -C "\
select second_id
from borrower
where btype like '%wsd%'
"
I can also just leave the SQL at the end intact on one line ....
... However, when I throw this in a script like:
$SQSH -o... (4 Replies)
This post is in reference to https://www.unix.com/shell-programming-scripting/137977-tricky-sed-awk-question-post302428154.html#post302428154
I am trying to go the opposite direction now:
I have the following file:
a,b,C,f,g
a,b,D,f,g
a,b,E,f,g
h,i,J,k,l
m,n,O,t,u
m,n,P,t,u
m,n,Q,t,u... (3 Replies)
Hi,
I need to embed a metatag to image files which contain qrcodes, i usually do this with exiv -M "set Exif.Image.DocumentName `zbarimg -q -Sdisable -Sqrcode.enable --raw image.tif`" image.tif
which works fine. However I need to do this recursivly for whole directory and subdiretory... (4 Replies)
I have some large login files that I need to extract (user)@(server) from. Where it gets tricky is that there is usually more than one '@' sign on each line(although it does have a leading space if it's not part of the (user)@(server) string), I need only the (user)@(server) section, I need only... (6 Replies)
Hi,
My first shell script is one that prints the five largest directories in a given directory. My current effort is as follows, it gives me the output I'd like, but I have to quote a globbed pathname, which seems wrong:
#!/bin/sh
du -hs $1 | sort -rn | head -n 5
And I must invoke... (2 Replies)
I am trying to write a BASH script that will prompt a user to enter a number of days, then calculate the date.
My problem is the date command uses single or double quotes. For Example..
date -d "7 days"
Here is an example of some same code I am trying to work through.
echo "when do you... (4 Replies)
Discussion started by: javajockey
4 Replies
LEARN ABOUT MOJAVE
xml::sax::exception5.18
XML::SAX::Exception(3) User Contributed Perl Documentation XML::SAX::Exception(3)NAME
XML::SAX::Exception - Exception classes for XML::SAX
SYNOPSIS
throw XML::SAX::Exception::NotSupported(
Message => "The foo feature is not supported",
);
DESCRIPTION
This module is the base class for all SAX Exceptions, those defined in the spec as well as those that one may create for one's own SAX
errors.
There are three subclasses included, corresponding to those of the SAX spec:
XML::SAX::Exception::NotSupported
XML::SAX::Exception::NotRecognized
XML::SAX::Exception::Parse
Use them wherever you want, and as much as possible when you encounter such errors. SAX is meant to use exceptions as much as possible to
flag problems.
CREATING NEW EXCEPTION CLASSES
All you need to do to create a new exception class is:
@XML::SAX::Exception::MyException::ISA = ('XML::SAX::Exception')
The given package doesn't need to exist, it'll behave correctly this way. If your exception refines an existing exception class, then you
may also inherit from that instead of from the base class.
THROWING EXCEPTIONS
This is as simple as exemplified in the SYNOPSIS. In fact, there's nothing more to know. All you have to do is:
throw XML::SAX::Exception::MyException( Message => 'Something went wrong' );
and voila, you've thrown an exception which can be caught in an eval block.
perl v5.18.2 2011-09-14 XML::SAX::Exception(3)