Sponsored Content
Top Forums Shell Programming and Scripting Retain quotes from bash script arguments Post 302216157 by cypression on Friday 18th of July 2008 05:49:51 AM
Old 07-18-2008
Hmm, I also tried changing the line that runs the command in the script to:
"$commandToRun" ~/t.txt
(which is arguably something I should've done before anyway), but now I get the following:

> myscript.sh grep "foo bar"
gives
grep foo bar: command not found

> myscript.sh grep \"foo bar\"
gives
grep "foo bar": command not found

Thanks again though :S

Last edited by cypression; 07-18-2008 at 06:50 AM.. Reason: typo
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to use in bash variables and quotes

I have some troubles with variables and quotes... I want: if $URL is empty (no user input) go to http://www.localhost/index.php/ else add this string (search) "?s=+$URL" EXAMPLE: No user input string= http://www.localhost/index.php/ User input = "unix" string=... (3 Replies)
Discussion started by: aspire
3 Replies

2. Shell Programming and Scripting

How to make 2 separate arguments in 1 bash script?

This is what I have: #!/bin/bash #ascript.sh WORD1=`tail -n +$1 /home/gscn/word1.txt | head -1` sed -e "s/WORD1/$WORD1/g" < /home/gscn/configtmp > /home/gscn/config WORD2=`tail -n +$1 /home/gscn/word2.txt | head -1` sed -e "s/WORD2/$WORD2/g" < /home/gscn/config2tmp >... (4 Replies)
Discussion started by: guitarscn
4 Replies

3. Shell Programming and Scripting

Quotes and arguments

Hello all, I have a very dumb problem while writing a script. I want it to execute the following command, but it's not executed because of wrong quotes. (3 Replies)
Discussion started by: privetq
3 Replies

4. Shell Programming and Scripting

Passing arguments from a bash shell script to a command

I'm pretty new to bash scripting and I've found myself writing things like this (and the same with even more nesting): if $CATEGORIES; then if $LABEL_SLOTS; then $pyth "$wd/texify_grammar.py" "$input" "$texfile" "--label-slots" "--categories" "$CATEGORY_LIST" ... (9 Replies)
Discussion started by: burbly
9 Replies

5. Shell Programming and Scripting

syntax issue with quotes in mysql command for a bash script

i'm trying to write a bash script that executes a mysql statement mysql -sN -e INSERT INTO "$database"."$tableprefix"users (var1, var2,var3) VALUES (123, '1','') i don't know where to put the quotes it doesnt work with this one: ` it seems i can only put double quotes around the... (0 Replies)
Discussion started by: vanessafan99
0 Replies

6. Shell Programming and Scripting

Bash script with arguments

Could someone help me with the script below? I am trying to make a script having just one arguement as a command and then it executes the appropriate code #!/bin/bash if then echo "Available commands:" echo "./exec.sh cmd1" echo "./exec.sh cmd2" elif then cmd1 =... (1 Reply)
Discussion started by: spiridakos
1 Replies

7. Shell Programming and Scripting

Nested double quotes won't work in my bash script?

In a bash script I have: LSCMD="find /project/media/ -mindepth 2 -maxdepth 2 -name \"files*pkg\"" ALL_PACKAGES=$( $LSCMD | sort 2>/dev/null) But I get nothing returned. It's just all blank. If I run the find command in a terminal, I get dozens of hits. I figure it's the way how I'm... (3 Replies)
Discussion started by: superbbrr
3 Replies

8. Shell Programming and Scripting

Pass arguments to bash script

myscript.sh #!/bin/bash ARGA=$1 if ; then echo "${ARGA}:Confirmed" else echo "${ARGA}:Unconfirmed" fi when I run the above script from the command line, i run it as: ./myscript.sh jsmith now some times, i need to runn it this way: (8 Replies)
Discussion started by: SkySmart
8 Replies

9. Shell Programming and Scripting

Passing arguments to a bash script

Hi, I wanted to pass an argument to a bash script. So that the argument is used inside the awk command inside the bash script. I know the noraml way of passing argument to a bash script as below : sh myScript.sh abc Inside the bash script i can use like this myArg1=$1 wc $myArg But... (8 Replies)
Discussion started by: shree11
8 Replies

10. Shell Programming and Scripting

Passing arguments to interactive program through bash script, here document

Dear Users, I have installed a standalone program to do multiple sequence alignment which takes user parameters to run the program. I have multiple sequence files and want to automate this process through a bash script. I have tried to write a small bash code but its throwing errors. Kindly... (13 Replies)
Discussion started by: biochemist
13 Replies
Mojolicious::Routes::Match(3pm) 			User Contributed Perl Documentation			   Mojolicious::Routes::Match(3pm)

NAME
Mojolicious::Routes::Match - Routes visitor SYNOPSIS
use Mojolicious::Routes; use Mojolicious::Routes::Match; # Routes my $r = Mojolicious::Routes->new; $r->get('/foo')->to(action => 'foo'); $r->put('/bar')->to(action => 'bar'); # Match my $m = Mojolicious::Routes::Match->new(PUT => '/bar'); $m->match($r); say $m->captures->{action}; DESCRIPTION
Mojolicious::Routes::Match is a visitor for Mojolicious::Routes structures. ATTRIBUTES
Mojolicious::Routes::Match implements the following attributes. "captures" my $captures = $m->captures; $m = $m->captures({foo => 'bar'}); Captured parameters. "endpoint" my $endpoint = $m->endpoint; $m = $m->endpoint(Mojolicious::Routes->new); The routes endpoint that actually matched. "root" my $root = $m->root; $m = $m->root($routes); The root of the routes tree. "stack" my $stack = $m->stack; $m = $m->stack([{foo => 'bar'}]); Captured parameters with nesting history. METHODS
Mojolicious::Routes::Match inherits all methods from Mojo::Base and implements the following ones. "new" my $m = Mojolicious::Routes::Match->new(GET => '/foo'); my $m = Mojolicious::Routes::Match->new(GET => '/foo', $ws); Construct a new match object. "match" $m->match(Mojolicious::Routes->new, Mojolicious::Controller->new); Match against a routes tree. "path_for" my $path = $m->path_for; my $path = $m->path_for(foo => 'bar'); my $path = $m->path_for({foo => 'bar'}); my $path = $m->path_for('named'); my $path = $m->path_for('named', foo => 'bar'); my $path = $m->path_for('named', {foo => 'bar'}); my ($path, $ws) = $m->path_for; my ($path, $ws) = $m->path_for(foo => 'bar'); my ($path, $ws) = $m->path_for({foo => 'bar'}); my ($path, $ws) = $m->path_for('named'); my ($path, $ws) = $m->path_for('named', foo => 'bar'); my ($path, $ws) = $m->path_for('named', {foo => 'bar'}); Render matching route with parameters into path. SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>. perl v5.14.2 2012-09-05 Mojolicious::Routes::Match(3pm)
All times are GMT -4. The time now is 11:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy