Bash script: bad interpreter

The first line, #!/bin/bash, tells Linux where to find the interpreter. The script should also be executable with chmod +x script.sh, which it appears you did. It is highly likely that you created this file with a windows editor, which will place a <cr><lf> at the end of each line. This is the standard under … Read more

Why is JavaScript called a “scripting language”?

I think first two sentences from wikipedia are clear enough: A scripting language, script language or extension language is a programming language that allows some control of a single or many software application(s). Languages chosen for scripting purposes are often much higher-level than the language used by the host application… In this case, the application … Read more

Can script.readyState be trusted to detect the end of dynamic script loading?

In Opera, the script.readyState property cannot be trusted. For example, the readyState “loaded” may be fired before the script runs in Opera 9.64. I performed the same test in Opera 9.64 and Opera 10, with different results. In Opera 9.64, the onreadystatechange handler gets fired twice, once before and once after the script runs. The … Read more

Is there an advantage to using Bash over Perl or Python? [closed]

Two advantages come to mind: Simplicity: direct access to all wonderful linux tools wc, ls, cat, grep, sed… etc. Why constantly use python’s subprocess module? I’m increasingly fond of using gnu parallel, with which you can execute your bash scripts in parallel. E.g. from the man page, batch create thumbs of all jpgs in directory … Read more

Sql*plus always returns exit code 0?

You have to explicitly tell sqlplus to do that, in your script. Basically, there are two statements that you can use: WHENEVER SQLERROR EXIT SQL.SQLCODE WHENEVER OSERROR EXIT For example: WHENEVER SQLERROR EXIT SQL.SQLCODE begin SELECT COLUMN_DOES_NOT_EXIST FROM DUAL; END; / And for OS errors: WHENEVER OSERROR EXIT FAILURE START no_such_file For more information, see … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)