Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [bash]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
81 views

Cross compiling file cannot execute: required file not found

I am struggling in trying to cross compile C program using wiringpi library in the ubuntu host, then transfer it to raspberry pi 4. My instruction used old version of wiringpi, which is not available ...
Phát Phạm's user avatar
0 votes
1 answer
41 views

I cannot login to my raspberry after uninstalling zsh

Raspberry is running fine, but I cannot login via ssh or directly on the device. Problem: I executed following command: sudo apt remove --purge zsh Yes I know I am a moron. I know I have to access /...
Watzefak's user avatar
0 votes
1 answer
37 views

Writing bash script to reboot pi 10 times and log output

I have written a Python script and scheduled it to run @reboot using cronjob. Sometimes this script throws an exception sometimes it works perfectly. I want to write test scripts for this. Preferably, ...
Osama Khalid's user avatar
0 votes
0 answers
21 views

How use microphone sound level to start arecord and or aplay

I start a simple project which use 2 raspberry. Both have microphon and speaker, and a button. The button starts the aplay and arecord commands for both of raspberry. And the full duplex communication ...
wanwan's user avatar
  • 1
0 votes
1 answer
60 views

Help with "-bash: syntax error near unexpected token `do' "

Background: Yes, I'm a noob. I've been learning Debian Linux the last several months. Here's the situation: I have 10 Raspberry Pi's (3B+) with hostname rpi-100 to rpi-109. I am trying to automate ...
Myszek512's user avatar
0 votes
2 answers
44 views

Cronjob not executing when raspberry pi reboots

The following is the Python script that I want to execute every time Raspberry Pi reboots. When I run this Python script directly from the terminal it works. Not only does IP gets stored in the file ...
Osama Khalid's user avatar
1 vote
1 answer
621 views

firefox in fullscreen mode on raspberry pi 4 (debian bookworm)

I need my raspberry (new Pi OS with debian bookworm) to show a certain web page in full mode, so I run this script firefox -kiosk -private 'www.example.com' and can expect firefox to open www.example....
tux's user avatar
  • 11
1 vote
1 answer
69 views

How to put Raspberry Pi into shutdown by keypress/hold?

I am running latest retropie on a rpi3b+. I am also using retrogame to map GPIO pins the keyboard keys to arcade buttons. What I would like to do is run the sudo shutdown command if a designated key (...
user76595's user avatar
  • 181
-1 votes
1 answer
47 views

php exec fails to launch browser via bash script

On a Raspberry Pi 3B+ (using stretch), I have a bash script that looks like this. pkill chromium-browse chromium-browser --noerrdialogs --disable-infobars --kiosk https://www.example.com --incognito ...
Chiwda's user avatar
  • 171
1 vote
0 answers
108 views

bash who command does not give datetime correctly on testing

Edit : We are still looking for differences that would explain why who does not work on testing for user lines (it works for boot lines for instance), this is differences on the code for following ...
JoelCrypto's user avatar
1 vote
1 answer
122 views

Output of cat command to a memory variable [closed]

Newbie question, but I'm missing something I'm issuing this command on my raspberry pi (zero 2W) cat /sys/firmware/devicetree/base/serial-number which works nicely. Cat will output the command to ...
codeputer's user avatar
  • 123
2 votes
1 answer
94 views

Error mounting drive at service startup (ExecStartPre)

As a precondition for starting my Syncthing service, I wish to mount an external USB drive (label MyBook). The action must be synchronous, so putting it anywhere else besides the service's ...
InteXX's user avatar
  • 145
0 votes
1 answer
91 views

LXDE autostart script runs repeatedly

I added the following line to my /etc/xdg/LXDE-pi/autostart: @bash '/pi/startService.sh' My startService.sh is opening an AppImage. However after closing the App it seems like the script is executed ...
Traxan's user avatar
  • 9
1 vote
0 answers
378 views

Install latest MariaDB properly via apt

Currently I'm running this helper function in my synced shell environments on all my Linux/macOS devices; install_mariadb() { local mariadb_version_test local mariadb_version local ...
Fëanorson's user avatar
1 vote
1 answer
130 views

if-else to check whether sd card or usb disk.? [closed]

How can I set this up so that it itself checks if there is an sd or usb, so it makes a backup depending on whether I have an sd card or usb disk attached? dd if=/dev/mmcblk0 of=${BACKUP_PATH}/${...
Assassins's user avatar
0 votes
1 answer
443 views

help with /etc/os-release echo $VERSION_CODENAME' [closed]

How can i make this : bash -c '. /etc/os-release; echo $VERSION_CODENAME' so it look like this : get_codename() { local VERSION_CODENAME VERSION_CODENAME=$(. /etc/os-release | awk '{print $1}') echo &...
Assassins's user avatar
1 vote
0 answers
120 views

Script only works after opening browser and closing it

I have a script to open 2 webpages one on each monitor. The end of the script selects one of the pages and enters in login credentials. The script works great and I have it working with systemctl to ...
Logan's user avatar
  • 11
1 vote
1 answer
191 views

Change the background color when the pi starts up

I have a setup with a headless Raspberrypi Zero attached to a screen and the pi user is automatically signed in so a Bash prompt is shown. The black shell background now interferes with how I want to ...
Besi's user avatar
  • 884
0 votes
1 answer
89 views

Working ssh tunnel script does not work when executed by 'on boot' techniques

The following works flawlessly, in that it allows me to access a webpage hosted on the Pi at my domain which is hooked up to a google compute vm. pi@raspberrypi:~ $ ./pi_home_reverse_proxy/scripts/...
Monty's user avatar
  • 1
0 votes
1 answer
143 views

Save continuous data printed in a bash shell in a file [closed]

we are working with a Sensor (Sensirion SDC41) connected to a Raspberry Pi 4. We have a .c file provided by Sensirion, that, when called in the bash shell, it outputs a continuous flux of data (one ...
robi_beginner's user avatar
0 votes
2 answers
401 views

Keeping a Python script for PWM running and just changing duty cycle

I am currently trying to connect a laser to my 3D printer and give a TTL signal manipulated by an M106 command. The "official" way didn't work out for me so right now I am trying to control ...
Gibby1999's user avatar
0 votes
1 answer
196 views

MOTD Statistics

I am attempting to create a MOTD using Bash that gives me some specific information about this machine. I’ve figured out how to get a lot of what I want, but is there a way to get available upgrades, ...
Jason Wood's user avatar
0 votes
5 answers
2k views

How to run a script (pointing to a python file) with root permission at startup in Raspberry Pi OS?

I am trying to run a script which ultimately runs a pagekite python file. The Pagekite offers tunnelling service for localhost to be publicly accessible. My aim is to run the pagekite.py when the Pi ...
DaSnipeKid's user avatar
0 votes
0 answers
124 views

What can I do? Installing software "E: Unable to fetch some archives" (Pure Data)

I'm trying to install Pure Data on my Pi with the command: sudo apt-get install puredata However, it isn't working and I'm getting the message: E: Unable to fetch some archives, maybe run apt-get ...
Mitchell Graham's user avatar
0 votes
2 answers
45 views

python code to read SMS not working when running under cron

I made a python code to read SMS from SIM800 module, that is connected to a Raspberry Pi Zero W, and it is working like a charm when I run it on a terminal or another IDE. Here is the expected result: ...
Luis Lange's user avatar
1 vote
0 answers
22 views

No mouse or keyboard until password entered [closed]

I'm trying to secure a Pi, and one of the things I'm keen on implementing - if possible - is that whatever input that comes in via the USB ports goes nowhere unless it's a 6-digit password (or longer) ...
Richard's user avatar
  • 11
0 votes
1 answer
122 views

Where can I get the current TLS_FINGERPRINT for pandora (pianobar)?

I've ran into this issue twice this month, where my auth would fail due to the TLS_FINGERPRINT. The first time, I found the key online on a forum. Now, I can't find the updated key anywhere. I've ...
CPH's user avatar
  • 121
0 votes
1 answer
289 views

Is there a substitute for ejecting a SD card on ubuntu

I am having issues ejecting an SD card from an ubuntu Rpi in my bash script. When I run the command to eject, the following error is displayed NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT ...
Stephen's user avatar
  • 11
-1 votes
1 answer
405 views

How to UNDO unwanted changes on my raspberry pi 4. Bash_profile not found

Updated Question. I was trying to add this directory "/usr/local/opt/python-3.9.0/bin" to PATH on raspberry pi 4 and so I edited the bash file by adding the line: PATH = "/usr/local/...
Julius Sechang Mboli's user avatar
0 votes
2 answers
200 views

Raspberry pi stuck at smbd.service?

I edited my /home/pi/.bashrc file, and i reboot it, but the raspberry pi stuck at smbd.service with the welcome screen.
vishnu's user avatar
  • 1
-1 votes
1 answer
32 views

Script declared in rc.local doesn't run after soft reboot

I have a Raspberry Pi 3 and two scripts that handle the updates of an app. download.sh update.sh download.sh downloads the new version of the app, prepares it for deployment and restarts the device. ...
Volpym's user avatar
  • 1
0 votes
1 answer
455 views

Systemd service not updating

I have a service on my Raspberry Pi which runs a bash file on boot. I recently updated the bash file (run.sh) but the service is not reflecting the update. So far I have tried: sudo systemctl disable/...
Jeremy Hamm's user avatar
0 votes
0 answers
128 views

How to install .deb of virtual keyboard on rpi zero (no internet)

I'm following this answer: https://raspberrypi.stackexchange.com/a/121642/74564 on how to install a virtual keyboard on rpi zero without internet access. cd /boot sudo dpkg -i matchbox* <- don't ...
Guerlando OCs's user avatar
0 votes
2 answers
679 views

Troubleshooting cron job to restart broken internet connection

I have a pi zero 1.3 running on an ethernet connection (using this hub hat). I am running it headless, so I can only access it via ssh. Every once in a while, the internet connection drops, and I have ...
Zach Taliaferro's user avatar
2 votes
0 answers
326 views

Running Simple Script On Every Boot

Want to run a bash script start.sh with one command that executes tmux and ffmpeg at startup on my Raspberry Pi 4B. The RPi OS loads the Desktop, but to interact with the process only need a terminal (...
nino's user avatar
  • 21
-2 votes
1 answer
829 views

Crontab Permission Denied running simple Python Script

I've been trying to get this to work for DAYS. Its doing my head in because everything i search suggests this work. The process is Cron executes bash which executes python I open and edit the cron ...
Felixr2's user avatar
0 votes
2 answers
500 views

Using shell with cron

I have an app controlling a piece of connected hardware that displays a few lines of info and requires user input (on stdio). The app runs fine from a shell. I set up the RPi to auto-login with CLI ...
user120300's user avatar
2 votes
0 answers
8k views

ufw Error: Couldn't determine iptables version [closed]

I am currently working on an automated shell setup script for my Raspberry Pi 4. This includes installing and setting up ufw as my firewall. However, I'm currently stuck with configuring ufw. My ...
Pievee's user avatar
  • 21
-2 votes
2 answers
843 views

How do I run a bash script at startup that stays open? [closed]

I have a bash script which is in this directory: /home/pi/darkCove/radio/start.sh It basically transmitts an FM signal. Here is the code: #!/bin/bash sudo ./pi_fm_rds -freq 87.5 -audio pulses.wav -...
wnetMC's user avatar
  • 105
1 vote
2 answers
2k views

Raspberry Pi4 uhubctl bash script wont run

Writing a bash script to turn on and off the USB ports on a raspberry pi 4. Using uhubctl. #!/bin/bash # Script to turn on and off power to usb port # Uses uhubctl # time_w=5 #cd uhubctl uhubctl -a ...
ShekelsBot's user avatar
1 vote
1 answer
2k views

How can I fix "atomic" related issues in my build?

I'm trying to build gRPC using this tutorial (https://lzqblog.top/2018-11-08/Cross-compile-gRPC-for-ARM/) but I still get "atomic" related issues (undefined reference: __atomic_fetch_add_8 )....
Don Madrino's user avatar
0 votes
2 answers
336 views

Unable to run bash after boot

I have a raspberry pi 4, EDIT: using python3.7, with raspbian OS Devian 10 Buster and I am trying to run a script afeterboot for people counting, it uses a virtual env, after reading various post this ...
Ivan's user avatar
  • 101
1 vote
1 answer
158 views

gallery-dl script doesn't work with crontab or rc.local but works manualy

I wrote a simple script that cycles through a file and grabs some links from a file to run through a program called gallery-dl. This script works fine if i run it manually but just wont work with ...
WaffleGod54's user avatar
1 vote
0 answers
290 views

GPIO input, keep high after button press

Hi was just wondering if there was a way of making a GPIO INPUT (connected to a momentary switch) stay high (for a certain amount of time), no matter how long the switch has been pressed for? The ...
OldGold's user avatar
  • 11
-1 votes
1 answer
215 views

How to restore /bin/sh

Sup yall, I was trying to fix GUI login or restore password issue on Raspberry Pi 4. There are so many topics and several solutions to solve a problem where you're stuck into a loop asking for a ...
Calpec's user avatar
  • 1
-1 votes
2 answers
655 views

.bashrc is executed once on boot and another time when terminal autostart via @lxterminal [repost with correct account] [duplicate]

I am using .bashrc to execute a python script on system boot: sudo -u pi python3 /path/to/script.py and then I add @lxterminal to file /etc/xdg/lxsession/LXDE-pi/autostart to make sure a terminal ...
Michael Chang's user avatar
0 votes
1 answer
237 views

Raspberry Pi POCSAG mail script

I have a Raspberry Pi configured as a Pocsag receiver with a RTL-SDR USB stick. Everything works just perfect, and it receives signals and messages. I then found a script that was supposed to be able ...
Hayvosh's user avatar
2 votes
2 answers
2k views

Artifactory Installation on Raspberry Pi 4

I have been trying to install Artifactory OSS on my new Raspberry Pi 4 (raspbian), but no luck so far. I tried all the following ways as suggested here but nothing worked. Archive Installation Docker ...
sateesh's user avatar
  • 141
2 votes
2 answers
756 views

SSH on boot via rc.local

I am trying to ssh into a server on boot. I have written a simple bash script to perform this action. The script works fine if I run it from the command line, issue is with rc.local. The script /home/...
Beaker's user avatar
  • 37
0 votes
2 answers
6k views

Unwritable file

I'm trying to edit the terminal on my Pi and whenever I edit my terminal with the command nano /boot/config.txt this comes up: nano /boot/config.txt unwritable Whenever I try to exit and try to ...
John Doolan's user avatar

1
2 3 4 5 6