Sponsored Content
Full Discussion: tutorials
Top Forums Shell Programming and Scripting tutorials Post 49150 by Optimus_P on Friday 26th of March 2004 11:41:34 AM
Old 03-26-2004
did you check our FAQ that address your specific question.
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Online Tutorials

Does anyone know of any decent online tutorials with regard to Solaris and/or Oracle, currently I'm just hamming my way through but would like to get some more in depth knowledge of the subjects. And as I'm sat at work all day with nothing to do, I thought I'd give the old brain a workout before... (1 Reply)
Discussion started by: kmugglet
1 Replies

2. Shell Programming and Scripting

tutorials about zsh

hi there I'm looking for tutorials about zsh (beginners to experts) can you give me addresses please? thx a lot (3 Replies)
Discussion started by: SpY974
3 Replies

3. Tips and Tutorials

Welcome to Tips and Tutorials

Tips and Tutorials was created partially as an overflow from our Answers to Frequently Asked Questions. We noticed that some of the info in that forum did not really answer a question that is frequently asked. We want to keep the FAQ forum small so that it is easily browsed. Also, a few users... (0 Replies)
Discussion started by: Perderabo
0 Replies

4. Programming

gdb Tutorials

Can anyone give me the link to a website having gdb tutorials (for advanaced debugging & shortcuts) http://www.burneddowndays.com/talk/YaBBImages/rolleyes.gif (1 Reply)
Discussion started by: wojtyla
1 Replies

5. Windows & DOS: Issues & Discussions

Cygwin Tutorials

Hi.. I required Cygwin User Guide and Reference Materials.If anybody knows the related URL Kindly help me. Thanks & Regards :) Sanjay.Karthik (1 Reply)
Discussion started by: sanjay.karthik
1 Replies

6. Programming

Encryption Tutorials

Hi , I would like to know how to write encrytion functions in c++ in linux environment.so would like u get some tutorials on the topic. Can anyone help (1 Reply)
Discussion started by: wojtyla
1 Replies

7. Linux

RHCE tutorials

Does anyone here who is an RHCE already? Do you have tutorials for this? (0 Replies)
Discussion started by: invinzin21
0 Replies

8. UNIX for Advanced & Expert Users

AutoSys Tutorials

Hi, Where can I find a good AutoSys User Guide so that I can get all the details on those AutoSys commands like "sendevent" and "autorep"? Thanks a lot in advance. (6 Replies)
Discussion started by: cpm189
6 Replies
SHELL-QUOTE(1p) 					User Contributed Perl Documentation					   SHELL-QUOTE(1p)

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.8.4 2005-05-03 SHELL-QUOTE(1p)
All times are GMT -4. The time now is 07:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy