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

Questions tagged [bash]

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

0
votes
0answers
11 views

Changing desktop background via bash [duplicate]

I'm trying to adjust the background on my Raspberry Pi via a bash script but I can't seem to find a way to do it without using a GUI. Does anyone know a way of doing this? Thanks, Richard
2
votes
2answers
35 views

Hardware Level Query for Pi Version

Is there a way you can query the model and revision of a Pi from a script without accessing files that are generated at install time for the OS? I have a project where a web page needs to display the ...
2
votes
1answer
50 views

Error in apt-get update

Whenever I run "sudo apt-get update" I get pi@raspberrypi:~ $ sudo apt-get update Hit:1 http://archive.raspberrypi.org/debian stretch InRelease Hit:2 http://raspbian.raspberrypi.org/raspbian stretch ...
2
votes
2answers
73 views

Waiting for network connectivity instead of just sleep fixed time

I'm new to the whole Raspberry Pi and Bash scripting thing, so bear with me. I run raspberry autopilot on a remotely controlled vehicle thru a 3G/4G connection. Raspberry Pi is installed onboard the ...
0
votes
0answers
14 views

Rotate script output on my TFT 3.5

I'm trying to use my TFT 3.5 screen on my rpi to rotate different scripts. The idea is to show pihole dashboard, digital clock and a custom message. I have tried to do it using the crontab: */3 0 0 ...
-1
votes
0answers
18 views

a linux script doesn't have color

i try to add a line to rc.local file in etcpath in rasbian stretch OS of raspberry pi3 by writing a script. my script doesn't work correctly and it copies many lines in the rc.local so i delete that ...
2
votes
0answers
56 views

Bash or python, what is the most efficient to use pi's `GPIO`s? [closed]

TL;DR EDIT: to clarify this question and why it's relevant to the PI: what is the most efficient way in term of absolute time and energy (which I guess is more related to clock cycle) to now the ...
1
vote
1answer
51 views

How can I reset my /home/.bash_profile?

I accidentally replaced my /home/.bash_profile with an empty file. My usually colored screen has turned black and white. (I'm running in command-line-mode with Raspbian Stretch Lite). How do I reset ...
1
vote
3answers
59 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
28 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
138 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
27 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
18 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
132 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
47 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
21 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
38 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
267 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
21 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
202 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
604 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
35 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
76 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
34 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
47 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
2answers
1k 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
60 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
402 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
89 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
120 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
2k 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
1k 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
409 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
122 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
166 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
101 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
326 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
672 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
102 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
74 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
416 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
5k 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
31 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
1k 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
24 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
328 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
300 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
61 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 ...
-1
votes
2answers
363 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 ...