I am using the below command in my Expect script file.
set name [StringToBytes "Tamin"];
puts "name = $name"
When i run this script, i get the below error.
invalid command name "StringToBytes"
while executing
"StringToBytes "Tamin""
invoked from within
"set name [StringToBytes "Tamin"]"
Can anyone please help me to fix this?
As far as I know, this means that the command StringToBytes could not be found. StringToBytes is not listed in the documentation, so presumably you intended to define this command yourself?
Related
I need to deploy database objects by calling a script. But it throws an error like this "PLS-00103: Encountered the symbol "PROMPT" ".
What could be the problem with my script?
My script is as follows:
set echo on
spool logs/dm_ref.log
Prompt Running dw/deploy/dm_ref/file.sql...
#dw/deploy/dm_ref/file.sql
Prompt Running dw/deploy/dm_ref/file_tbl.sql...
#dw/deploy/dm_ref/file_tbl.sql
spool off
set echo off
the 2nd Prompt is for creating a table which successfully runs.
The problem is with the first Prompt for which it creates a stored procedure.
Thank's in advance.
The main issue is you're not giving us enough information to answer your question.
SQL Developer's script engine DOES support the PROMPT command.
Please amend your question to include the spooled output, the error message, and the contents of your .sql files you are executing.
I have a bash script which does the following:
#!/bin/bash
moduleName=$1
someInfo=`ls | grep -w moduleName`
echo $someInfo
In the line #3, I was supposed to use $moduleName, but I missed it.
Is there any way to find such issues in Bash scripts?
I used shell Check, but it didn't report this issue.
For me, the script looks fine; it lists the files whose name contain the string moduleName.
The script is syntactically correct.
The error in line #3 is a semantic error; it changes the meaning of the script. Only a person that knows the intention of the script can detect it.
There is no way to automatically detect such errors, unless you write a software that reads your mind and knows that you intended to write $moduleName and you mistakenly wrote moduleName instead.
Can someone help me with this:
How to write a UNIX shell script that takes a parameter. The parameter passed should be the name of a file that is executable. Validate the parameter and if it is not valid output an appropriate error message and ensure your script exits with an overall status of error. If the parameter is valid execute the parameter. If the execution of the parameter fails then output an appropriate error message and ensure your script exits with an overall status of error. If the parameter is valid and executed successfully my script should exit with an overall status of success.
Okay, that's not a prob.
Split your task into 4 simple steps:
How to pass command line arguments to bash script.
How to check whether executable file exists.
How to display message in bash.
How to execute something from bash.
You'r welcome!
So I was trying to download somevideos using rtmpdump, and I used this shell script which is supposed to download the some videos but it gave me and error message saying
./script: line 9: $1: ambiguous redirect
Now I am pretty sure that I am doing something silly so I will tell you exactly what I did. I first downloaded that above file into my system saved it as "script". And opened terminal and typed:
./script
and it gave me the above error.
Now I have also gone through this thread, and also some other threads but they don't seem help me at all and now I have nowhere to go. please save me.
script tries to use $1 as the name of a file for redirection (e.g., someCommand > "$1"), but you didn't supply a an argument when you called script.
The script needs a file as the first parameter which will have one video to download per line
I am trying to figure out why I get an error when trying to set an environment variable.
I write the following command in a cmd.exe shell.
set logFile=%time:~0,2%
but I keep on getting the following error message
Environment variable 13 not defined
Can someone assist?
GorovDude
That is really strange. Your code should work. It seems that the batch is ignoring the logFile= in your code.
To verify this try:
set logFile
to see if logFile is indeed not set.
Have you tried typing the code directly into the command prompt?