06-06-2011
This explains in a bit detail.
4 Ways of Executing a Shell Script in UNIX / Linux (link removed)
This User Gave Thanks to panyam For This Post:
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I just want the output of this command to be stored in a variable like,
str = `grep Application.dbName serverdata/ServerProp.txt`
but while executing it says like,
str : startup 11: not found, where startup is the script name.
but while running the command alone like,
grep... (2 Replies)
Discussion started by: cs_sakthi
2 Replies
2. Shell Programming and Scripting
Hi
Please let me know is there any way through which I can find out errors & do debugging in FTP scripts.
Thanks
Sourabh
TCS (1 Reply)
Discussion started by: sourabhshakya
1 Replies
3. UNIX for Dummies Questions & Answers
I have a shell script, which calls a load script to load a database. How can i handle errors in Unix(similar to 'error level' in Batch scripts)? I am trying to use 'mailx' to send a Success/failure message based on the error level returned by the load script.
I have already used an error log... (2 Replies)
Discussion started by: sarsani
2 Replies
4. Shell Programming and Scripting
hi friends,
i m tryin to load data from one set of table to other i have sql procedure al ready for it..!
i m going to load the procedure only if data in one of my table for example
table "landing " have 10 records each attribute of this table is
file_name status date ... (2 Replies)
Discussion started by: kulbir
2 Replies
5. UNIX for Advanced & Expert Users
we're seeing very strange "No such file or directory" errors on NFS volumes on one of our suse servers - can anyone please help?
we're seeing it for both our NetApp NAS Device and one of our Solaris NFS servers too
Here is what we're seeing:
stg-backup:~ # cd /rmt/sge
stg-backup:/rmt/sge... (3 Replies)
Discussion started by: fishsponge
3 Replies
6. Shell Programming and Scripting
The first step for you to create the script to change “JAVA_OPTS” variable definition as follows:
Original line:
JAVA_OPTS="-Dname=$JAVA_NAME -Xmx$JVM_MAX -DAGENT_HOME=$RT_HOME -DINSTALL_DIR=$RT_HOME -Djavax.net.ssl.keyStore=$RT_HOME/conf/client.keystore ... (3 Replies)
Discussion started by: asirohi
3 Replies
7. Shell Programming and Scripting
Good day,
I am trying to add signal handling capabilities to some of my scripts. Unfortunately, I am having some difficulty with the manner in which signals are propagated between parent/child processes. Consider the following example:
I have the following "parent" script:
#!/usr/bin/sh... (5 Replies)
Discussion started by: danie.ludick
5 Replies
8. Shell Programming and Scripting
1.Display a list of /usr/share/doc subdirectories containing information about shells.How many README files do these subdirectories contain? Don't count anything in the form of "README.a_string".
2.Make a list of files in your home directory that were changed less that 10 hours ago, using grep,... (2 Replies)
Discussion started by: cynosure2009
2 Replies
9. Shell Programming and Scripting
Hi all,
if any body could help me out to automate the unix script for finding some particualar files which are based on dates
like see every day i need check the TXT files which are being in processed and Sequential order based on dates
For Example:
files name starts at... (12 Replies)
Discussion started by: krux_rap
12 Replies
LEARN ABOUT CENTOS
shell-quote
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)