Sponsored Content
Top Forums Shell Programming and Scripting Bash- Command run from script does not pass full parameters with spaces inside Post 302655755 by AcerAspirant on Wednesday 13th of June 2012 06:31:27 PM
Old 06-13-2012
Bash- Command run from script does not pass full parameters with spaces inside

There's a JavaScript file that I call from command line (there's a framework) like so:

Code:
./RunDiag.js param1:'string one here' param2:'string two here'

I have a shell script where I invoke the above command. I can run it in a script as simple as this

Code:
#!/bin/bash

stuff="./RunDiag.js param1:'string one here' param2:'string two here'"
$stuff

When I run this within a script, the parameters are all truncated, each becoming 'string, instead of the entire parameter. Why? When I run this command from command line, no such thing occurs.

---------- Post updated at 03:31 PM ---------- Previous update was at 02:03 PM ----------

Having done more testing, it seems like that every time there's a space between items in the string, such as "string one", the spaces are converted into commas: string,one - any idea what might be causing this?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to pass two or more parameters to the main in shell script

Hey Guys from the below script what I understood is we are sending the the first parameter as input to the main (){} file main > $LOGFILE 2>&1 but can we send two or three parameter as input to this main file as main > $LOGFILE 2>&1 2>&2 like this Can any one plz help I need to writ a... (0 Replies)
Discussion started by: pinky
0 Replies

2. Shell Programming and Scripting

Run the command inside perl script

I have a command which will run fine in a unix command prompt. Can you tell how to interprete this command inside perl script...... The command is : perl -pe 's/(\|333\}.*)\}$/$1|1.6}/' FIA.txt This will search for the number 333 and appends 1.6 at the end of that line....... (1 Reply)
Discussion started by: vinay123
1 Replies

3. Shell Programming and Scripting

How to pass parameters transparently into a sub script

Hi, I am trying to write a script like this: #!/bin/ksh #script name: msgflow #The awk commands for Solaris and Linux are incompatible if ] then msgflow-solaris $* elif ] then msgflow-linux $* fi This script is shared by a file system which is visible to both... (3 Replies)
Discussion started by: danielnpu
3 Replies

4. Shell Programming and Scripting

need to pass parameters to working and tested awk script

I have a working and tested AWK script that removes duplicates from an input file and generates an output file without the duplicates. I had help from my other post to develop it: ... (3 Replies)
Discussion started by: script_op2a
3 Replies

5. Shell Programming and Scripting

Need help! command working ok when executed in command line, but fails when run inside a script!

Hi everyone, when executing this command in unix: echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error. here is content of my script: tdbsrvr$ vi hc.sh "hc.sh" 22 lines, 509... (4 Replies)
Discussion started by: 4dirk1
4 Replies

6. Shell Programming and Scripting

Preserve extented ascii character when run echo comand inside bash script

Hi everyone, I'm echo some text with extended ascii characters as below: echo -e "Pr\xE9sentation du spectacle" > output or echo -e "Présentation du spectacle" > outputIf I open the file created I see this text Présentation du spectacleThe text is shown correctly in this created file when... (7 Replies)
Discussion started by: Ophiuchus
7 Replies

7. Shell Programming and Scripting

Pass Parameters to awk command

I need to pass values at runtime for the below awk command where l is the length and partial.txt is the file name. awk -v l=285 '{s="%-"l"s\n";printf(s,$0);}' partial.txt > temp1.txt; (5 Replies)
Discussion started by: Amrutha24
5 Replies

8. Shell Programming and Scripting

Run bash command inside zsh script

Hi, I would like to run following code in bash inside a zsh script. (In this case is output unfortunately very different if you run it in zsh). I tried to put "bash" in front of the code but I obtained following error message "bash: do: No such file or directory " eve though I merged the whole... (7 Replies)
Discussion started by: kamcamonty
7 Replies

9. Shell Programming and Scripting

Listen sharp time to run a command inside a script

Hello, Just wondered if there is any possibility to run a command at sharp time inside a script in linux. My question is not about crontab Example: #!/bin/bash cd /home/database for i in * do command 1 if time is 19:00, day is Monday then run command2 if time is 20:00, day is... (10 Replies)
Discussion started by: baris35
10 Replies

10. Shell Programming and Scripting

Executing sed command inside a bash script

I want to run commands inside a bash script. An example is I want to pass the command in a string as regexp as an argument to the script, then run sed on the bash variable sed.sh regexp sed.sh "-i \"s/<p>//g\"" then call sed "$regexp" $fl (3 Replies)
Discussion started by: Kangol
3 Replies
RHINO-DEBUGGER(1)					      General Commands Manual						 RHINO-DEBUGGER(1)

NAME
rhino-debugger - invokes the rhino JavaScript debugger GUI SYNOPSIS
rhino-debugger [options] script_filename_or_url [script_arguments] DESCRIPTION
This manual page documents briefly the rhino-debugger command. This manual page was written for the Debian distribution because the origi- nal program does not have a manual page. It is written according to the html documentation. rhino-debugger is a start script for the rhino JavaScript debugger. The Rhino JavaScript debugger is a GUI that allows debugging of inter- preted JavaScript scripts run in Rhino. Note that this debugger will not work with JavaScript scripts run in the mozilla browser since Rhino is not the engine used in such environments. OPTIONS
-e script_source Executes script_source as a JavaScript script. -f script_filename_or_url Reads script_filename_or_url content and execute it as a JavaScript script. -opt, -O optLevel Optimizes at level optLevel, which must be an integer between 0 and 9. -version versionNumber Specifies the language version to compile with. The string versionNumber must be one of 100, 110, 120, 130, or 140. See JavaScript Language Versions for more information on language versions. -strict Enable strict mode. EXAMPLE
Example debugging the NervousText.js applet written in JavaScript. The example is provided in the librhino-java-doc package. $ rhino-debugger NervousText.js SEE ALSO
The online documentation under http://www.mozilla.org/rhino/debugger.html AUTHOR
This manual page was written by Damien Raude-Morvan <drazzib@debian.org>, for the Debian project (but may be used by others). Friday 17, 2009 RHINO-DEBUGGER(1)
All times are GMT -4. The time now is 09:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy