Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

For questions pertaining to the `bash` shell command processor.

0
votes
3answers
43 views

Bash script help on RPi

I have a bash script that runs every hour. Output of this is sent to me via email. This is run through cronjob. #!/bin/bash # Script: temp_email.sh # --------------------------------------------------...
1
vote
1answer
19 views

Getting Service status and automatic mounting of external drives

I have following bash script, I wanted to add few more things to it: (This script runs from root cronjob every 6 hours). Device is Raspberry Pi running raspberian. #!/bin/bash # Script: temp_email.sh ...
0
votes
1answer
18 views

run bash script at startup

i needed 50+ rp points to comment on this one: Run bash script on startup my "problem" is that i use adafruits read only script: https://github.com/adafruit/Raspberry-Pi-Installer-Scripts/blob/...
1
vote
1answer
21 views

Cronjob is missing the GET parameter in Raspberry Pi

I am using a headless raspbian OS on Raspverry Pi 3B+. I have placed the following code at the home directory of the user pi #!/usr/bin/env python import socket import httplib s = socket.socket(...
0
votes
0answers
14 views

How to run a web page with cache refresh using chromium-browser and command line?

I can start a web page with command line like that cromium-browser http://some-page.com. How can I start a web page with command line and with hard refresh cache option (equivalent of CTRL-F5 if I ...
0
votes
2answers
65 views

How to run a python program from a bash script on startup?

I have a python script that is located at /etc/testscripts/WebServer. I call this usually from the command line by calling sudo python3.6 /etc/testscripts/WebServer. I have a bash script that looks ...
-2
votes
1answer
38 views

How to compare if the cpu serial is correct

I have a question. I would like to check when the raspi system starts or if the serial cpu is correct. If not, he would be rebooting. So he would be doing reboot loops all the time. I found the ...
0
votes
0answers
16 views

How to custom the x11vnc login page

run the following command for start vnc: x11vnc -unixpw_cmd ./abc.sh -http_oneport How can i custom the login page? For example, add some message. For the abc.sh script is refer from http://www....
1
vote
4answers
37 views

Trying to write to a file from a script. Hitting unexpected permission issues

I am trying to write a script to edit systemd files. On the CLI I can use the command: sudo systemctl edit test.service That opens a text editor, I make the changes and save no problems. In a bash ...
1
vote
2answers
97 views

open a terminal on boot and auto-run a looping python script

When my RPI3 is booted, I would like it to automatically have the terminal open with my python script already running. Note that it loops endlessly. I want to open the terminal so I check the output ...
0
votes
0answers
17 views

How to execute a script.sh with a sequence of joystick+button

I would like to know if I could find a way to bind a combo like the "hadouken" (Hadouken is a combination of movement of a joystick: down, down-right, right + button ) of street fighter to make an ...
0
votes
1answer
136 views

How to run a script which uses I/O's on startup?

I have a python script which makes use of the standard RPi I/O's where I am detecting multiple inputs and storing values to a database. The script runs without exiting until the Pi is powered off. ...
2
votes
2answers
151 views

How did I launch this Python script at boot?

I have a Python script running at boot, on a Raspberry Pi, and of course I didn't write down how I set it up. Now I need to change it, and I can't for the life of me figure out how it's getting ...
1
vote
2answers
32 views

Bash script doubt - How can I automatically update the hwclock with NTP when I have internet connection

Bash script in How can I automatically update the hwclock with NTP when I have internet connection seems not to run as expected in Raspbian Stretch 9.4 The log file will be created with the first ...
0
votes
1answer
54 views

“bash: rbenv: command not found” and “bash: nodenv: command not found”

After trying to install this script using these commands: $ git clone git://github.com/mislav/dotfiles.git ~/dotfiles $ ~/dotfiles/script/bootstrap I restarted my Raspberry Pi and I'm seeing these ...
1
vote
1answer
30 views

latest raspbian kernel update broke bash

I just updated by raspbian box (stretch, upgraded raspbian-kernel, using it as console only) and somehow broke bash. Every time I try to log in (either by ssh or locally) I get the following error: ...
1
vote
2answers
46 views

Skip first job run at reboot with Cron

I'm trying to run a Bash script with Cron every 5 minutes to check if my Raspberry Pi have changed its IP address or not and update me, this is the script i'm using. #!/bin/bash #check and send ip ...
1
vote
1answer
680 views

Accessing EXPORTED Environment Variables in Python

An often asked question, I know, but after searching through other solutions I'm still having problems. Most solutions say to make sure your variables are exported before trying to access them, but ...
0
votes
0answers
41 views

Open one LXTerminal at a time

I am using .bashrc file to launch python scripts when lxterminal is launched. The problem is that i don't want the user to be able to start another lxterminal and therefore retrigger the same scripts ...
1
vote
1answer
76 views

How do I make sudo!! add a space after sudo?

When I type sudo!! it never puts a space between sudo and anything. How do I make sudo!! add a space? Example: nano text.txt sudo!! sudonano text.txt Maybe I am using it wrong but it never works ...
0
votes
1answer
320 views

Connection to a Wi-Fi network without password

I'm currently working on my Raspberry Pi, running Raspbian, trying to connect to a network without password using iwconfig. ifconfig wlan0 results : ifconfig wlan0 wlan0 Link encap:Ethernet ...
-2
votes
1answer
57 views

How to write a script which execute multiple commands on multiple terminal windows

I am trying to make a script on the following basis: Open a terminal window (keep it open) and run cd ~/dir/dir/dir ./exec Open a second terminal window (keep it open) and run /usr/bin/xterm -font/...
-1
votes
1answer
104 views

Copying the Numbers detected by OCR

Heyo, Im working on a project with a Raspberry pi3, and i got an OCR working. Im using ssocr https://www.unix-ag.uni-kl.de/~auerswal/ssocr/ and it is detecting the Numbers on my pictures correctly. ...
1
vote
3answers
1k views

How to stop a Python script running at startup by default?

I am setting up a Raspberry Pi Zero with a camera and want the Pi to automatically log on to the terminal then run a motion detecting script in a infinite loop. I put it in the /etc/profile and the ...
0
votes
2answers
700 views

How do I set the default maximum Java heap size? [closed]

I want to set the default Java heap size to 1024m without needing to specify the -Xmx option every time I run a jar file. Tried adding export JAVA_OPTIONS=-Xmx1024m to .bashrc file but it didn't ...
0
votes
1answer
321 views

Autostart python script and see its output on the terminal

Is there any way that i can auto run a python script at boot and see its output on the terminal other than editing the .bashrc file ? I tried using crontab job and putting myscript in /etc/init.d/ ...
0
votes
1answer
104 views

how to run rtl_fm from a bash script

I'd like to know if it's possible to run rtl_fm from a .sh file: I know it's possible, but what I'd like to do is to run it, record for 5 seconds (I can place a sleep here) and stop the process (in ...
0
votes
0answers
139 views

After sometime Pi hdmi screen blank while display screen by fbi and video by omxplayer serially

I am running fbi and omxplayer serially and after fbi statement sufficient sleep by calculating total files multiply by image screen ON time fbi statement fbi -autozoom -norandom -timeout $timeout -...
-1
votes
1answer
78 views

raspberrypi - on boot not running my infinite python script?

I have a Python script, which needs to run 24/7 to use GPIO high/low. So on boot i wanted it to run as below. But it never works to run python script on other hand it does create /tmp/test file? How ...
0
votes
0answers
234 views

Can't access to motion from internet

I'm trying to make a server with motion , lighttpd and cgi scripting bash, everything is fine excepted from outside of my network (internet). Those are my files and log. Somebody can help me please? I ...
-1
votes
2answers
457 views

Bash install script not working

I am making something to show my school which will be installed on multiple RasPi 3s, using Stretch Lite. Because of this, I have made an 'install script' which runs all of the installing packages ...
1
vote
0answers
70 views

Using source command in bash

As described here Is there a difference between “.” and “source” in bash, after all?, I'm trying to set-up this approach in a simple script without success so far (Raspian Jessie). When using the ...
0
votes
0answers
59 views

Disable command line terminal of HDMI

I want to disable command line terminal of hdmi screen at both boot and runtime so that on runtime or poweroff it should not appear. sudo sh -c "TERM=linux setterm -foreground black -clear all >/...
0
votes
1answer
289 views

Failed to connect to bus

I tried with restart "sudo shutdown -r 0", but I got an error: "Failed to connect to bus:no such file or directory" What does this mean? I worked on headless Raspberry on some server configuration ...
2
votes
1answer
3k views

Remote full reset (re-install) of a Raspberry

I've had a Raspberry Pi now for some time. I did a lot of fun stuff with it. A lot of the fun stuff is still on there, and that's not always fun. I could reset my Raspberry Pi by walking over to it, ...
1
vote
2answers
30 views

Script inserts literal * instead of wildcard ONLY during boot

This has driven me crazy so I hope someone can help. I have a script that works perfectly when executed manually or when restarting lightdm, but when it runs during a boot and auto-login, it returns ...
1
vote
2answers
947 views

Continuesly monitor GPIO input change/events in Bash

On a Raspberry Pi you can set the GPIO pins as an output or an input. An output or an input can be either high or low. For example, to monitor the input state (high or low) of GPIO pin 26 you can ...
0
votes
2answers
22 views

command not doing anything when executing

Sketch of situation I am running a small game server, openttd, on my (headless) raspberry pi 3B. I have been able to play this game, with a huge map, so resources are fine (if you don't mind waiting ...
1
vote
1answer
280 views

How to check for alive process in an infinite loop and use LED as status indicator?

Clearly I'm a beginner when it comes to setting up a script. I'm trying to check if a process is alive and running, and if so, switch on an LED. I need help with the following: Check if a process is ...
1
vote
0answers
250 views

MIDI out over USB

I'm trying to build a MIDI controller using a Raspberry Pi Zero. I have all the hardware and code to process the (analog) input signals, but I can't figure out how to send the MIDI data over USB. I ...
1
vote
1answer
59 views

How can I create a new Login menu for the pi and run my own script? (run script before pi login)

I want to run a script after pi boots but before log in (Raspbian Stretch Lite). It should run after all the other configurations are done. So I thought about finding and changing the RPi log in ...
0
votes
2answers
302 views

Why is my script running twice when i autostart through .bashrc?

I'm sure this has been answered before but I can't seem to find the solution that works. I am running the latest Raspbian on an RPi 3. I created a bash script named "loop.sh" that loops through two ...
1
vote
1answer
583 views

how to run an http online radio with omxplayer in background?

I use omxplayer to stream a internet radio, but omxplayer is printing a whole lot of stats on the terminal, i want it fully in background. i tried redirecting the stdout and stderr with &> /dev/...
3
votes
1answer
267 views

How to Fake Ctrl-C?

When I run an mp3 command by doing mpg123 Thunder.mp3, it runs in a loop. Is there any way to fake a Control-C keyboard interrupt via bash script?
4
votes
1answer
603 views

Is `command-not-found` broken?

There's a really great package that I love called command-not-found. When you type unknown commands, it searches through apt and suggests packages to install. It has worked in Raspberry Pi before. ...
2
votes
1answer
27 views

Why am I getting two processes when I add something to my .bashrc

I am hacking around with a component on a board that needs networking. To accomplish that I open a terminal at startup and I added a startup.sh script to the bottom of my ~/.bashrc. However, when I ...
1
vote
2answers
2k views

How do I make .sh run on boot to console?

I've made a basic script to run my Discord bot however, I can't get it to run on startup. I keep on getting an error saying. I'm using this Run bash script on startup and I still get an error " 'Run....
1
vote
1answer
160 views

Run script on terminal at startup

I want to run a command in a terminal (not background) every time my pi is completely booted (once it loads the desktop). I tried to edit the rc.local and add these commands sleep 10 chromium-browser ...
1
vote
1answer
75 views

Display and Close image through bash script Rpi [closed]

I am trying to display image and close it through bash/shell script on a raspberry pi. My program opens the image but it doesn't close. what am I doing wrong? Can it be done in the same script I am ...
-6
votes
1answer
389 views

Writing a script to run multiple scripts on the Raspberry Pi, as part of a larger physical computing project [closed]

I am a beginner with raspberry pi and python, and I’m building an alarm clock project. Can anyone tell me how to write a script to call on all of the other scripts. For example, I have three scripts ...