standard input is not a terminal device - bash

I am trying to execute a customised command to upgrade software.
executable-name -d /dev/ttySP1 -f media1/sda1/file.txt
this line is added in a shell script. gives below error when executed from shell script. runs independently from command prompt
'standard input is not a terminal device'
please comment if some one has faced same issue or has any idea.
I am using beaglebone . Linux os.

Related

How to execute a long CURL command on zsh on mac terminal?

Trying to run a curl command on macos terminal which I was able to run from a windows command prompt. The curl command is relatively long with multiple "--data-urlencode" flags (5 total) and then the final -v flag. On windows, I can simply copy/paste the command to the command prompt or powershell, press Enter, and it runs fine. However, on macos terminal using zsh, the command prompt just shows a reverse prompt after I try to press Enter. It's as if it is waiting for more input or some other run command which I am not aware of.
On macos, I have been able to run shorter curl commands without any issues, but when I paste in a relatively longer curl command, I am presented with more prompts as if zsh doesn't realize the command input is done. I have also tried to manually type out the command to see if copy/paste is the issue, but same problem. I have also tried to change the order of the flag options, but that doesn't make any difference either. I have googled the heck out of this, but alas - no joy.

how to run .sh file in Ubuntu using installScript

I am creating an installation using InstallShield 2018 in windows 10. I need to execute a script file (.sh) in Ubuntu from a function in Installscript. I tried the following but it did not work:
szCmdPath = "C:\\Users\\Admin\\AppData\\Local\\Microsoft\\WindowsApps\\Ubuntu.exe";
szCmdLine = ". /mnt/d/test.sh";
LaunchAppAndWait( szCmdPath, szCmdLine, WAIT);
However I can execute the exact same file in Ubuntu Terminal and it works great. I did turn on Window sub system for Linux and install Ubuntu on windows. Why is this happening? Why can I run cmd.exe from installscript but not Ubuntu?
Thank you in advance.
EDIT 1: if I pass an empty string as parameter, Ubuntu is start and waits for my input commands. But when I pass the path to my script file, nothing happened except a flash of the terminal console before my installation goes on running.
From my reading, wsl and ubuntu differ slightly. It looks like wsl is a bit magical and occasionally similar to bash -c or ubuntu -c, whereas you can consider Ubuntu.exe as somewhat equivalent to /bin/bash.
If you try to run /bin/bash . /mnt/d/test.sh from a bash prompt, things don't go well. So the correct approach will depend on the contents of your script and what you need to happen. I think one of the following options are the most likely:
remove . from your command; instead run ...\Ubuntu.exe /mnt/d/test.sh
add -c to your command; instead run ...\Ubuntu.exe -c . /mnt/d/test.sh
Note that %LOCALAPPDATA%\Microsoft\WindowsApps\Ubuntu.exe is a special file (zero bytes), so it's also plausible that it needs some special handling. For instance, maybe it requires a 64-bit caller. If that's the case, you may need to wrap it in a call through a 64-bit cmd prompt. My quick tests don't show this as likely, however, so I think it will work without this extra indirection.

How to call Ubuntu bash from windows command prompt and redirect output to a file?

In Windows 10 there is this Ubuntu Bash (Bash/WSL) and we can initiate it from cmd using bash -c "command". This will initiate Ubuntu Bash and run the command in Linux environment. What I want is to redirect the out put of particular command into a text file.
Ex: bash -c "command" >> file.txt should have worked according to my knowledge but it didn't and I get Error: 0x80070057 on the text file.
Anyway, I solved the issue for the moment using the redirect of bash. I wrote a .sh file to use a redirect of Ubuntu Bash to write the content to a file.
Ex: bash -c ./run_command.sh on windows cmd, where run_command.sh contained command >> file.txt.
I think this is not the better solution for this. It should be able to do using windows cmd redirect.

AppleOS Terminal to MS Command Prompt translation

How do I translate the Terminal command
pdf2txt.py -o filename.txt -t tag filename.pdf
for the Command Prompt on a Windows machine?
The commands are arguments passed to the pdf2txt.py script and they depend on the code inside the file, not on any terminal/command prompt constraints. So, the code remains exactly the same

Ruby system command not working outside console

I am trying to run growlnotify from inside a ruby script.
The command I am using is this system("growlnotify Test -m message").
If I use the terminal to execute the script it works fine. If I use Textmate to run the script or Geektool (the eventual target of the script) it does not ever run the growlnotify part. Each other part of the script runs using Textmate or Geektool, but only using the terminal causes Growl to launch a notification window.
Anyone used this tool before?
Is growlnotify in the PATH that TextMate uses?
Try passing the complete path to growlnotify: ie /usr/local/bin/growlnotify
A backtick is the little apostrophe like mark on the same key as the tilde.
`growlnotify -m message`
does the same thing as
system("growlnotify -m message")
except it also gives you the output of the command.
Another variation is
%x{growlnotify -m message}

Resources