use taosBenchmark to insert binary data with specified length in command line - tdengine

In TDengine database, I tried to use taosBenchmark to write binary data with specified length in command line, but I got following error
root#Alex ~ $ taosBenchmark -b int,int,binary(100)
-bash: syntax error near unexpected token `('
what is the correct way to use taosBenchamark to write binary data in command line?

try taosBenchmark -b int,intbinary\(100\)

Related

T-SQL error if use dollar and bracket symbols together

I'm getting the following error message with execution T-SQL script with this construction "$(", in sqlcmd utility:
C:\Users\Admin>sqlcmd -S DESKTOP-5AA9JIA\SQLEXPRESS -q "select '$(' " -R
Sqlcmd: Error: Syntax error at line 1 near command '''.
1>
if run this script via SSMS then everything works smoothly.
Getting the same error, when using INSERT INTO statement or any other statement.
Any suggestion on how to resolve it?
You should use -x when launch sqlcmd to ignore scripting variables.
-x
Causes sqlcmd to ignore scripting variables. This is useful when a
script contains many INSERT statements that may contain strings that
have the same format as regular variables, such as $(variable_name).
sqlcmd Utility
When sqlcmd parser sees $(it expects scripting variable that is not provided so it throws the error.
Here is my test:

curl from a bat file is giving different results than from command line

I have a bat file with the single command. When I execute it from the build.bat file I get a 6KB file that looks like it's complete with with tons of missing content.
curl --data "loc=C%3A%5CUsers%5Cuser1%5CDocuments%5test%5Cengizmo&subdirs=1&verbosity=4&vector=all&treestyle=1&stylesheet=notepad++" -s -o "C:\tmp\curl.html" --url "http://localhost:8001/rips/main.php"
When I execute the same line from the command line I get a 65KB file with the expected output. I've deleted the output file numerous times so I know that each is creating the right files.
curl 7.45.0 (i386-pc-win32) libcurl/7.45.0 OpenSSL/1.0.2a zlib/1.2.8 libssh2/1.4.3
The answer as shree.pat18 figured out was I did not use the escape characters for the % file in the data for the curl call.

I am getting error "array.sh: 3: array.sh: Syntax error: "(" unexpected"

I have written the following code:
#!/bin/bash
#Simple array
array=(1 2 3 4 5)
echo ${array[*]}
And I am getting error:
array.sh: 3: array.sh: Syntax error: "(" unexpected
From what I came to know from Google, that this might be due to the fact that Ubuntu is now not taking "#!/bin/bash" by default... but then again I added the line but the error is still coming.
Also I have tried by executing bash array.sh but no luck! It prints blank.
My Ubuntu version is: Ubuntu 14.04
Given that script:
#!/bin/bash
#Simple array
array=(1 2 3 4 5)
echo ${array[*]}
and assuming:
It's in a file in your current directory named array.sh;
You've done chmod +x array.sh;
You have a sufficiently new version of bash installed in /bin/bash (you report that you have 4.3.8, which is certainly new enough); and
You execute it correctly
then that should work without any problem.
If you execute the script by typing
./array.sh
the system will pay attention to the #!/bin/bash line and execute the script using /bin/bash.
If you execute it by typing something like:
sh ./array.sh
then it will execute it using /bin/sh. On Ubuntu, /bin/sh is typically a symbolic link to /bin/dash, a Bourne-like shell that doesn't support arrays. That will give you exactly the error message that you report.
The shell used to execute a script is not affected by which shell you're currently using or by which shell is configured as your login shell in /etc/passwd or equivalent (unless you use the source or . command).
In your own answer, you say you fixed the problem by using chsh to change your default login shell to /bin/bash. That by itself should not have any effect. (And /bin/bash is the default login shell on Ubuntu anyway; had you changed it to something else previously?)
What must have happened is that you changed the command you use from sh ./array.sh to ./array.sh without realizing it.
Try running sh ./array.sh and see if you get the same error.
Instead of using sh to run the script,
try the following command:
bash ./array.sh
I solved the problem miraculously. In order to solve the issue, I found a link where it was described to be gone by using the following code. After executing them, the issue got resolved.
chsh -s /bin/bash adhikarisubir
grep ^adhikarisubir /etc/passwd
FYI, "adhikarisubir" is my username.
After executing these commands, bash array.sh produced the desired result.

tcshrc setting path getting error

im trying to set the environment path to run pintos command like this in my home floder under ubuntu
set path = ($path /home/pintos/src/utils)
and I type terminal command try to compile this
:~$ source .tcshrc
but it seems get error like this
bash: .tcshrc: line 1: syntax error near unexpected token `('
bash: .tcshrc: line 1: `set path = ($path /home/pintos/src/utils)'
I dont know where is the syntax error is ...
You source your script, which is perfectly valid for [t]csh, into your running shell, which happens to be bash (and not tcsh).
If you're going to use tcsh, just run it (by typing tcsh) and ensure that your ~/.tcshrc has the desired effect. (Then, maybe, use chsh to change your login shell).
If you're going to use bash, set path using PATH=$PATH:/home/pintos/src/utils, in ~/.bashrc and/or in ~/.bash_profile.

Unexpected sh syntax error while using popen

I have written a C code as given below for decrypting an encrypted string, using popen for the purpose.
snprintf(cmdcheck,1000,"echo %s %c openssl aes-256-cbc -d -a -salt -pass pass:excel2012", idcheck,'|');
FILE *cmdid = popen(cmdcheck,"r");
The code complies well, but on running gives the following error:
sh: Syntax error: "|" unexpected
What can be done to resolve the issue? Thanks in advance. My operating platform is Linux.
the clue is that the error is coming out of sh - "|" is a reserved character in sh so you need to escape it: '\|' should do it.

Resources