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:
I have a shell script where I invoke the above command. I can run it in a script as simple as this
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?
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)
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)
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT CENTOS
rhino
RHINO(1) General Commands Manual RHINO(1)NAME
rhino - invokes the JavaScript shell for running scripts in batch mode or interactive
SYNOPSIS
rhino [options] script_filename_or_url [script_arguments]
DESCRIPTION
This manual page documents briefly the rhino command.
rhino is a start script for the rhino JavaScript shell which provides a simple way to run scripts in batch mode or an interactive environ-
ment for exploratory programming.
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.
PREDEFINED PROPERTIES
Scripts executing in the shell have access to some additional properties of the top-level object.
arguments
The arguments object is an array containing the strings of all the arguments given at the command line when the shell was invoked.
help() Executing the help function will print usage and help messages.
defineClass(className)
Define an extension using the Java class named with the string argument className. Uses ScriptableObject.defineClass() to define the
extension.
deserialize(filename)
Restore from the specified file an object previously written by a call to serialize.
load([filename,...])
Load JavaScript source files named by string arguments. If multiple arguments are given, each file is read in and executed in turn.
loadClass(className)
Load and execute the class named by the string argument className. The class must be a class that implements the Script interface,
as will any script compiled by jsc.
print([expr...])
Evaluate and print expressions. Evaluates each expression, converts the result to a string, and prints it.
readFile(path[,characterCoding])
Read given file and convert its bytes to a string using the specified character coding or default character coding if explicit cod-
ing argument is not given.
readUrl(url[,characterCoding])
Open an input connection to the given string url, read all its bytes and convert them to a string using the specified character cod-
ing or default character coding if explicit coding argument is not given.
runCommand(commandName,[arg,...][options])
Execute the specified command with the given argument and options as a separate process and return the exit status of the process.
For details, see JavaDoc for org.mozilla.javascript.tools.shell.Global#runCommand.
serialize(object,filename)
Serialize the given object to the specified file.
spawn(functionOrScript)
Run the given function or script in a different thread.
sync(function)
creates a synchronized function (in the sense of a Java synchronized method) from an existing function. The new function synchro-
nizes on the this object of its invocation.
quit() Quit shell. The shell will also quit in interactive mode if an end-of-file character is typed at the prompt.
version([number])
Get or set JavaScript version number. If no argument is supplied, the current version number is returned. If an argument is sup-
plied, it is expected to be one of 100, 110, 120, 130, or 140 to indicate JavaScript version 1.0, 1.1, 1.2, 1.3, or 1.4 respec-
tively.
SEE ALSO
The online documentation under http://www.mozilla.org/rhino/shell.html <http://www.mozilla.org/rhino/shell.html>
AUTHOR
This manual page was written by Wolfgang Baer <WBaer@gmx.de>.
February 12, 2005 RHINO(1)