Questions tagged [bash]

For questions pertaining to the bash shell command processor.

BASH stands for Bourne Again SHell which refers to the fact that BASH is a superset of an older Bourne shell (sh). It is a widely used Unix shell - a command processor interpreting user input interactively or reading commands from a script file.

265 questions
5
votes
2 answers

bash: npm: command not found

I ran sudo apt-get install npm in the terminal: Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these: The following packages have unmet…
Sarthak Mittal
  • 81
  • 1
  • 1
  • 6
4
votes
2 answers

TAB completion acting weird

I'm using RPi on Debian GNU/Linux 7.9 (wheezy) with bash, and have a problem with tab completion. By default, it only shows the first match, even if there are more. If I press TAB more, nothing happens, there are four as you can see: When I edit…
Niclas
  • 141
  • 4
2
votes
2 answers

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 and I'm not sure what is wrong. I suspect "Anything…
JanezKranjski
  • 141
  • 1
  • 6
2
votes
1 answer

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?
ToXicL 16
  • 19
  • 1
  • 8
2
votes
1 answer

How do I undo this command?

I was having trouble with transmission and ran this command: sudo systemctl enable NetworkManager-wait-online.service My Raspberry Pi doesn't connect to LAN now. How can I undo this?
letterhead
  • 165
  • 1
  • 7
1
vote
3 answers

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 script has two threads I think. The problem is I…
kwjamesblond
  • 11
  • 1
  • 2
1
vote
2 answers

update-rc.d: error: insserv rejected the script header

After following this guide here on my Raspberry Pi 3: http://www.instructables.com/id/Turn-your-Raspberry-Pi-into-a-Portable-Bluetooth-A/?ALLSTEPS (Step 6) I came across an error which says update-rc.d: error: insserv rejected the script header when…
Oliver Kuchies
  • 235
  • 1
  • 4
  • 13
1
vote
0 answers

tmux not executing particular line

I am running two mesh-networking daemons, namely A.L.F.R.E.D. and BATADV-VIS on Raspberry Pi-2. BATADV-VIS is dependent on ALFRED hence I am using tmux to run them as a complete session. I have created a bash file which I call from the…
Shan-Desai
  • 1,531
  • 2
  • 13
  • 28
1
vote
1 answer

Output of cat command to a memory variable

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 stdout... but I want the output to a memory…
codeputer
  • 123
  • 5
1
vote
2 answers

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 off -l 1-1 # sleep "$time_w" # uhubctl -a on -l…
ShekelsBot
  • 19
  • 6
0
votes
2 answers

Copy contents of bash script to new bash script

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 to echo or printf the contents of the other bash…
T. Cubbin
  • 30
  • 6
0
votes
0 answers

Terminal: text coloring works, but not blinking

I have raspberry PI connected to a monitor. I do not login into raspberry, it simple boots up and stays on the login screen. After the raspberry boots up, rc.local executes my shell script, which echos all the output from remote server's tail…
0x29a
  • 135
  • 6
0
votes
2 answers

script not executing after boot

I added this to the file /etc/rc.local, just before the exit 0 cd ~/Dekstop bash play_video.sh The script on the desktop contains this: #!/bin/bash omxplayer --loop --blank video.mp4 After booting nothing is happening. What is wrong?
clankill3r
  • 202
  • 1
  • 3
  • 10
0
votes
1 answer

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, bad login attempts, and SSL Cert durations? I’m…
0
votes
2 answers

virtualenvironmentwrapper: workon from bash script works only if source ~/.profile is called explicitly

I am running a bash script that activates a virtualenvironment workon myenv on the raspberry pi and then runs a python script. Unfortunately, the virtual environment cannot be activated, I get the error workon: command not found I came across the…
1
2