Stack Exchange Network

Stack Exchange network consists of 175 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.

1
vote
1answer
27 views

RPI project Minecraft Server

me and a project partner are running a Minecraft server off of a RPI and connecting via its wireless feature. we wanted to create a python script which would control an LED and toggle it on/off based ...
1
vote
0answers
23 views

Bash script running fine in terminal window, but not when added to autostart

I use a script to start the google voice assistant on my rpi. This script runs fine when I run it from a terminal window, but when I try to run it via the LXDE autostartup nothing happens. It used to ...
0
votes
1answer
26 views

How to send data from raspberry pi to AVR over bluetooth?

I am searching for a way to send data from raspberry pi to my AVR using HM10 or HC05, both of which are available. What I need to do is to read values from a .txt file and send it from the raspberry ...
1
vote
2answers
29 views

Add external conf to wpa_supplicant.conf

I have a use case where I need to read USB drive for wifi credential and add it to wpa_supplicant.conf file. It seems possible to add those details into the wpa_supplicant.conf. But I can see there ...
0
votes
0answers
12 views

.bashrc file getting wiped on reboot

I have a problem on my PI3 where my ~/.bashrc is getting wiped when I reboot the PI (all text in the file gone). I then lose color in my terminal and have to copy a backup into the file which works ...
1
vote
1answer
36 views

Raspberry Pi 3 B not working after interrupting the Raspbian Upgrade

I was upgrading my ADC Hat mounted(no other sensors), Raspberry Pi 3 B (Stretch installed) using; sudo apt-get update sudo apt-get upgrade During the middle of the upgrade, there was a message with ...
1
vote
2answers
65 views

Find out whether SPI is enabled or not

I have a game that needs SPI. In the installation instructions, I noted that SPI has to be enabled via raspi-config. Now, I'd like to check in a shell script whether the user has activated SPI or not....
1
vote
0answers
19 views

Supervisor config and certain python files

I need to start on boot and monitoring a python script with supervisor. The python script works when starting manually by sudo python getdata.py My scripy getdata.py executes subprocess.call(['bash',...
10
votes
2answers
2k views

Navigating through USB drive with “cd /myOtherFolder” causes “no such directory” error

When navigating the file system of my USB drive in the terminal, some weird things happen that didn't used to happen on my Raspberry Pi B+. I'm not quite sure how to articulate this, so I'll just show ...
0
votes
0answers
19 views

Python3 Error while accessing from a Particular path

I'm Getting the following errors while using python3 from a fixed location, here it is 'python' Directory (/home/pi/python) pi@rituraj:~/python $ python3 Python 3.4.2 (default, Feb 10 2019, 17:23:02) ...
1
vote
2answers
228 views

Why doesn't my autostart file run a simple shell script

I am trying to launch a simple script (let's say it is /home/pi/python/python_code/hello-world.sh) from the /home/pi/.config/lxsession/LXDE-pi/autostart file. I have added the following line to the ...
1
vote
0answers
67 views

l2ping bluetooth not timing out fast enough

I have been experimenting with pinging a list of known Bluetooth MAC addresses for a tracking project with a Pi 3, however, the ping does not seem to time out until after 5-7 seconds if there is no ...
2
votes
1answer
233 views

Why am I getting bash: esptool.py: command not found on new Raspbian install after installing esptool.py

I am having major difficulty in installing MicroPython onto an ESP3 using my RPi3B+ (may ask about this elsewhere) but for now I am trying to achieve this on a new fresh install/distro of Raspbian. ...
0
votes
0answers
113 views

Getting error: `/usr/bin/veracrypt: No such file or directory` after installing veracrypt

I am trying to install the armv7 version of Veracrypt on my Raspberry Pi. I downloaded it from: https://launchpad.net/veracrypt/trunk/1.21/+download/veracrypt-1.21-raspbian-setup.tar.bz2, unzipped and ...
0
votes
2answers
39 views

Copy contents of bash script to new bash script [closed]

My job is installing multiple RaspPi's and they all need to be set up the same way, with a couple bash scripts, some installed programs and a cron that I wrote. Is there a way I can write one script ...
1
vote
1answer
60 views

Scanning a QR code using a raspberry pi zero or a Pi3 via a command line script

I need to scan a QR code via the command line when a script is run. My current setup is an epaper display with integrated 4 buttons. So far I have each button programmed to run a script to change ...
0
votes
1answer
44 views

Removing autostart program from .bashrc

Hello guys I made a really dumb mistake by adding a python script in .bashrc. I wanted to make this script autostart and followed a tutorial, where it said i should add it to .bashrc. Later on i read ...
0
votes
4answers
86 views

what are the low level steps to control the internal pull-up resistors?

I use Raspberry's GPIO from Bash because it only require 6 lines for what I need: a button and a LED. I can read an input, and write an output. Very simple. But I can not find how to active/...
0
votes
1answer
131 views

How to kill feh after calling it with bash?

I have the following code that monitors a directory for any new pictures that are placed into it by a camera. It's not working in it's current state, but the idea is that when it detects a new picture ...
1
vote
0answers
57 views

How to run a graphical program from a restricted user

I have two users. admin can see everything. pi is restricted. I have a tkinter python application. pi must be able to run the program, but it cannot read any of the files directly. There is a data....
0
votes
1answer
29 views

Python script execution time limits?

I have a python3 script called bot.py which is running a simple (for now) telegram bot, and I can retrieve some PI system states. It's required to maintain the bot online, so I added next string to ...
0
votes
0answers
12 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
93 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
2answers
297 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
84 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
24 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 ...
2
votes
0answers
65 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
301 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
66 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
29 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
439 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
33 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
2answers
414 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
61 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 ...
1
vote
4answers
43 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
685 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
1answer
440 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
1k 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
45 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
131 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
47 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
49 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
3k 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
75 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
77 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
610 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
152 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
150 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
2k 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 ...