9 More Discussions You Might Find Interesting
1. Programming
Hi,
I have an issue with a PERL5 script that calls MQCONN. I get this error on this Perl step when connecting to my Q manager: "Undefined Undefined subroutine &main::MQCONN called at ./quelog.pl "
I use this code:$Hconn = MQCONN($QMGR,$CompCode,$Reason);
In my .profile:
export... (2 Replies)
Discussion started by: mrn6430
2 Replies
2. Linux
Can someone please tell me how I can find out what version of SNMP I have running on any linux and solaris server?
i would think this was an easy thing to find. but google wasn't able to turn up anything on this.
snmp -v should do the trick but it doesn't.
thank you guys (1 Reply)
Discussion started by: SkySmart
1 Replies
3. UNIX for Advanced & Expert Users
How can I find out with a C program, on which RedHat version the program is being ran ? I do know through compilation variables that I'm on RedHat but so far cannot find out which one.
Currently the closest I got was to invoke an ls or cat through syscall for the release or motd files.
... (5 Replies)
Discussion started by: amirvosko
5 Replies
4. Programming
Iam new to shellscript.
1)How to strart QUERYMANAGER using shellscript.
2)How to put and get messages in MQSeries using shellscripts.
3)iam using local queues .
Thanks lot. (0 Replies)
Discussion started by: ram2s2001
0 Replies
5. Shell Programming and Scripting
hi,
i am looking through the perl documentation in the man pages for the first time but I have looked at some other reference giudes before (at a glance) and remember that there is a find command used by perl can any one give me a structured example of that command and how it works and if possible... (2 Replies)
Discussion started by: moxxx68
2 Replies
6. UNIX for Advanced & Expert Users
Hi,
I wanted to know how can I get the version of underlying HP-OS installed on a HPUX workstation. The output required is "June 2001" version or "March 2003" version etc whatever OS is present.
Thanx in advance for your help.
Regards,
Pankaj (3 Replies)
Discussion started by: pankschawla
3 Replies
7. UNIX for Dummies Questions & Answers
Hi,
Is there anyway to find what version of a software is installed on a particular box ?
For Tru64 unix, the setld -i command lists all the software that is installed. But how do i get the version ? is there a unix command for this?
Is setld specific to Tru64 ?
Do reply
VJ (1 Reply)
Discussion started by: vjsony
1 Replies
8. UNIX for Dummies Questions & Answers
How can I find out? Besides looking on the box of my distro and checking their. (2 Replies)
Discussion started by: DISTURBED
2 Replies
9. UNIX for Dummies Questions & Answers
I am extremely new here. Someone wants to upgrade off of Unix to Windows 2000 and wants to know if they need to buy new hardware
How do I find out what type of Unix they're using?
How do I find out the current hardware of the system? (Intel, ..etc)
Thanks (3 Replies)
Discussion started by: tomsha
3 Replies
SHELL-QUOTE(1) User Contributed Perl Documentation SHELL-QUOTE(1)
NAME
shell-quote - quote arguments for safe use, unmodified in a shell command
SYNOPSIS
shell-quote [switch]... arg...
DESCRIPTION
shell-quote lets you pass arbitrary strings through the shell so that they won't be changed by the shell. This lets you process commands
or files with embedded white space or shell globbing characters safely. Here are a few examples.
EXAMPLES
ssh preserving args
When running a remote command with ssh, ssh doesn't preserve the separate arguments it receives. It just joins them with spaces and
passes them to "$SHELL -c". This doesn't work as intended:
ssh host touch 'hi there' # fails
It creates 2 files, hi and there. Instead, do this:
cmd=`shell-quote touch 'hi there'`
ssh host "$cmd"
This gives you just 1 file, hi there.
process find output
It's not ordinarily possible to process an arbitrary list of files output by find with a shell script. Anything you put in $IFS to
split up the output could legitimately be in a file's name. Here's how you can do it using shell-quote:
eval set -- `find -type f -print0 | xargs -0 shell-quote --`
debug shell scripts
shell-quote is better than echo for debugging shell scripts.
debug() {
[ -z "$debug" ] || shell-quote "debug:" "$@"
}
With echo you can't tell the difference between "debug 'foo bar'" and "debug foo bar", but with shell-quote you can.
save a command for later
shell-quote can be used to build up a shell command to run later. Say you want the user to be able to give you switches for a command
you're going to run. If you don't want the switches to be re-evaluated by the shell (which is usually a good idea, else there are
things the user can't pass through), you can do something like this:
user_switches=
while [ $# != 0 ]
do
case x$1 in
x--pass-through)
[ $# -gt 1 ] || die "need an argument for $1"
user_switches="$user_switches "`shell-quote -- "$2"`
shift;;
# process other switches
esac
shift
done
# later
eval "shell-quote some-command $user_switches my args"
OPTIONS
--debug
Turn debugging on.
--help
Show the usage message and die.
--version
Show the version number and exit.
AVAILABILITY
The code is licensed under the GNU GPL. Check http://www.argon.org/~roderick/ or CPAN for updated versions.
AUTHOR
Roderick Schertler <roderick@argon.org>
perl v5.16.3 2010-06-11 SHELL-QUOTE(1)