Command 'bison name.y' doesn't work but not give out any error. system path correctly set up - powershell

I'm trying to run the command bison file_name.y from PowerShell, but it does not work. the command seems to be executed by the shell in fact the shell returns to ask for input but does not produce any output. I also tried the command bison file_name.y -d but I got the same result. I have checked the system variables and are correctly set. In fact, flex works correctly, for which I followed the same procedure.

Related

In Jupyter Notebooks on Google Colab, what's the difference between using % and ! to run a shell command?

Question is in the title.
I know that % usually denotes a "magic variable" in IPython. That's not a concept I'm terribly familiar with yet, but I have read about it.
However, today I saw a tutorial where someone was using it to run a shell command. Normally I have seen and used !.
Is there a difference? Both seem to be doing the same thing when I try them.
The difference is this:
When you run a command with !, it directly executes a bash command in a subshell.
When you run a command with %, it executes one of the magic commands defined in IPython.
Some of the magic commands defined by IPython deliberately mirror bash commands, but they differ in the implementation details.
For example, running the !cd bash command does not persistently change your directory, because it runs in a temporary subshell. However, running the %cd magic command will persistently change your directory:
!pwd
# /content
!cd sample_data/
!pwd
# /content
%cd sample_data/
!pwd
# /content/sample_data
Read more in IPython: Built-in Magic Commands.

second line on my system or python terminal now saying: “ -bash: zzzzz#: command not found“

I have been trying to pip install psycopg2 for some time now
I have just updated to python 3.7.4, before this problem started.
To set my path to a specific python version I used the code below.
nano .bash_profile
I thought that it would now be easy for my system to identify the path of the newly installed python, as to enable it to install psycopg2. Then the below started happening.
The second line of system terminal or python terminal is now always showing:
-bash: zzzzz#: command not found on my terminal
No matter what I type on my terminal, I am always getting command not found
This would mean you literally have "zzzzz" somewhere in the bash_profile. Bash is seeing "zzzzz" as just another command to run at startup like the rest of the profile script. As there is nothing in your PATH matching that string, bash reports the issue back to you.
Either remove the extra line from your .bash_profile. OR use a terribly wasteful work-around!
ln -s /bin/true /bin/zzzzz
This will create a symbolic link to the "true" binary (all it ever does is return true) from zzzzz. Now bash can find zzzzz and run it during start up, which does nothing. No more error and an absurd work around. You should fix the file.

Launch external program with multiple commands via Powershell

I am currently attempting to launch a different console (.exe) and pass multiple commands; while starting and entering a command works just fine, I haven't been able to find out how multiple ones can be entered via powershell.
& "C:\Program Files\Docker Toolbox\start.sh" docker-compose up -d --build
The given command works fine, but as mentioned I need to pass more than one command - I tried using arrays, ScriptBlocks and different sequences, though to no avail.
Edit:
Noticed that the docker build has a -f tag which allows me to specify a file; however, the issue now seems to be that the executed cmd removes all backslashes & special characters, rendering the path given useless.
Example:
&"C:\Program Files\Docker Toolbox\start.sh" 'docker-compose build -f
path\to\dockerfile'
will result in an error stating that "pathtodockerfile" is an invalid path.
Your start.sh needs to be able to handle multiple arguments. This doesn't look like a PowerShell question
Turns out that it was easier than expected; Solved it by executing a seperate file that contained the two commands needed and passing it to the start.sh file.
&"C:\Program Files\Docker Toolbox\start.sh" './xyz/fileContainingCommands.sh'

Can I automate Windbg to attach to a process and set breakpoints?

I am debugging a windows process that crashes if the execution stops for even a few milliseconds. (I don't know how many exactly, but it is definitely less than the time taken by my reflexes to resume the process.)
I know I can launch a windbg session via the command prompt by typing in windbg -p PID which brings up the GUI. But can I then further pass it windbg commands via the command prompt, such as bm *foo!bar* ".frame;gc";g".
Because If I can pass it these commands I can write these down in a .bat file and just run it. There would at least be no delay due to entering (or even copy-pasting) the commands.
Use the -c parameter to pass them:
windbg -p PID -c "bm *foo!bar* .frame;gc;g"
According to the help (found by running windbg /?):
-c "command"
Specifies the initial debugger command to run at start-up. This command must be enclosed in quotation marks. Multiple commands can be separated with semicolons. (If you have a long command list, it may be easier to put them in a script and then use the -c option with the $<, $><, $><, $$>< (Run Script File) command.)
If you are starting a debugging client, this command must be intended for the debugging server. Client-specific commands, such as .lsrcpath, are not allowed.
You may need to play around with the quotes...
Edit: Based on this answer, you might be better off putting the commands into a script file to deal with the quotes:
script.txt (I think this is what you want):
bm *foo!bar* ".frame;gc"
g
Then in your batch file:
windbg -p PID -c "$<full_path_to_script_txt"

DBD::Oracle fails to connect with OCIEnvInit when called when accessed through webserver only

I have a simple perl script that uses DBD::Oracle to run a query and print the results. It works fine from the command line, but I also have a PHP script that runs it and reads the output. When the PHP script is accessed through apache it fails to connect, with the error "OCIEnvInit".
I've tried creating a shell script that re-sets all the environment variables available in the shell but that didn't help, and I also tried setting the debugging output for DBI but got nothing. What could cause this error when the script does work?
Are you sure that ORACLE_HOME and other relevant environment variables (e.g., LD_LIBRARY_PATH) that are set in your shell when you run the script from the command line are also set to the same values in the apache/PHP process?