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.

9
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
17 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) ...
0
votes
2answers
89 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
37 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
65 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
52 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
38 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
37 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
31 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
57 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
92 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
32 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
24 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
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
74 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
163 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
80 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
21 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
60 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
135 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
62 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
272 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
32 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
275 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
52 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
42 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
463 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
304 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
993 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
40 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
103 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
39 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
2k 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
67 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
520 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
116 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
137 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 ...
0
votes
1answer
490 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
135 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 ...
-1
votes
1answer
136 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
371 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
909 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
141 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
82 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
520 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 ...