Questions tagged [bash]

Bash is a command processor, typically run at the command-line, allowing the user to type commands which cause actions. Bash can also read commands from a file, called a script.

Filter by
Sorted by
Tagged with
0 votes
0 answers
386 views

permission denied only AFTER becoming root (in Termux)

I'm running SuperSu 2.82 (latest) and Termux (latest) on Andriod 7. What is causing the permission denied error below? I get the same error with mount namespace separation turned off (or on) in ...
user avatar
  • 607
0 votes
0 answers
89 views

Create and edit a bash script in an USB connected smartphone

The question explains it all. I am using Ubuntu 20.04 LTS. I have connected an android smartphone to pc using USB. Changed directory to internal storage using: cd /run/user/*/gvfs/*/'Internal Shared ...
user avatar
0 votes
0 answers
122 views

Problem in installation of PrimeOS

When I want to install PrimeOS, I see a black page with a bash like command line instead of choices for choosing. Is it normal? If it is normal, what should I do and type in the page? In all PrimeOS ...
user avatar
1 vote
1 answer
61 views

Is there a workaround to use of bash via adb on LineageOS17?

I try to login in my device directly vith adb shell bash -i It kind of partially works, because I'm logged with bash, but the terminal loose completion. The error I get: $ adb shell bash -i bash: ...
user avatar
3 votes
1 answer
111 views

Android execute script at logout

I would like to execute a script at logout with my GS7 android 9 (Resurrection Remix). I see that it is advised to use tasker. I guess it is possible to do that without installing a graphical ...
user avatar
  • 31
1 vote
0 answers
249 views

Getting "CANNOT LINK EXECUTABLE "inotifywait": library "libnotifytools.so" not found. " when tyring to run a script that uses the inotifywait binary

The script is here: https://github.com/Magisk-Modules-Repo/com.piyushgarg.rclone/blob/master/binary/syncd.sh The code that I do not believe is working is this: while true; do if [[ ! -e ${...
user avatar
  • 11
0 votes
0 answers
45 views

How to Create batch SYMLinks

I'm installing legacy Termux on an Android 6.0 device. I downloaded the legacy app- and the legacy packages. There is a txt file with all the symlinks that need to be created. I'm looking for a way to ...
user avatar
  • 918
2 votes
1 answer
260 views

Android stops/pauses execution of my background script?

Short version: Why is my bash script (running in the background, started via SSHD) not running every ~30 seconds when it should? (NOTE: SSHD and the script are running as root!) I have a script that ...
user avatar
  • 462
2 votes
1 answer
139 views

SHELL Command works fine as a standalone command, but fails when put into a shell script?

Android 8.1 PIXEL 2 with root access. I have seen this asked here once before but the only solution didn't help me at all. I am going to try and make this as simple as I can for the example. If I ...
user avatar
0 votes
0 answers
2k views

rooted device: how to run SSH server persistent even on reboot

I (linux user but not an expert) just moved from iOS to android, my device is rooted (Samsung s9) and I want a ssh server running all the time on my android device (I prefer openssh over dropbear) ...
user avatar
  • 101
0 votes
0 answers
2k views

How to check installed TWRP version?

I’d like to know if there is a way to check what version of TWRP is installed using bash (using a file or command in Android). I could find /persist/.twrps only, which is data file. No command I have ...
user avatar
0 votes
1 answer
1k views

Change file (pictures, videos) timestamp from filename

When moving files around tru different dirs and across PC / smartphone, timestamp for last modified date usually get reset to the very datetime of move / copy operation. This lead to files being non-...
user avatar
  • 454
1 vote
1 answer
415 views

How to enable/disable lock screen from shell script when a special wifi SSID is present?

My Java skills are low, but I'm mastering shell. Is use LineageOS 14.1 (forked from cyanogenmod). I would like to create a shell script on a rooted devive to enable/disable lockscreen (PIN). I ...
user avatar
1 vote
1 answer
916 views

What are the differences between these adb and fastboot packages?

In my Bash shell, I have the packages: adb vs android-tools-adb as well as fastboot vs android-tools-fastboot. For reference I am trying to root my device, and later use these tools to learn about ...
user avatar
  • 133
-1 votes
1 answer
341 views

Install Bash on Samsung Galaxy Grand Prime+

How to install Bash on Samsung Galaxy Grand Prime+? How to get root permission and install Bash? Thank in advance !
user avatar
  • 103
0 votes
2 answers
343 views

Empty variables in termux' bash

I want to perform a test: if a certain variable exists, is non-empty, and its value matches an existing directory, then "exists" should be outputted. I did the following: $ echo $var $ if [ -d $var ...
user avatar
0 votes
0 answers
53 views

Cant manage to mount sdcard on cyanogenmod

So I know that you are not found of cyanogenmod but I don't really know where else could I ask that. So I'm trying to use a classe 10 SD-card which is called "corrupted" when I first insert it. From ...
user avatar
  • 125
1 vote
1 answer
268 views

How to keep an ODROID device connectable via adb?

I'm using an Odroid (rooted) device running Android 5.1.1 on a local network and I'd like to be able to control it via adb. Currently I'm running this at startup: setprop service.adb.tcp.port 5555 ...
user avatar
9 votes
3 answers
10k views

How to access and modify previous commands (bash history) in Termux

I use Termux on my Fairphone 2 and I want to speed up working with it. What slows me down is not having an up arrow key that I can use to access the last command in my bash history. I can do !! !7 and ...
user avatar
  • 275
1 vote
1 answer
6k views

Reason for chroot failure: tmp-mksh: chroot: not found

Introduction: I formatted a SDCard in ext4 and copied an ArchVersion on it to run it from Android like in this guide (step 6). Of course my device is rooted and am running the following scripts and ...
user avatar
0 votes
1 answer
2k views

Addon.d bash script for removing apks after nightly reflash on Android 5.1 CM12.1 not working

I'm trying to have a bash script in /system/addon.d/ that removes unwanted apks from a nightly Android 5.1 (CM12.1) install for my Galaxy Nexus phone. Each new nightly reflash will reinstall some ...
user avatar
1 vote
2 answers
2k views

Backup all apks from device using adb: why this loop in bash script doesn't work?

You can do adb shell pm list packages, and after reading through the list, do an adb shell pm path "com.yourpackage" to get the full path and do a simply adb pull. Fact is: I want to automate this. I ...
user avatar
3 votes
0 answers
614 views

Checking if audio is playing with bash script on Tasker

I have the small script below to check if audio is in use on my Android. if grep -q RUNNING /proc/asound/card*/pcm*/sub*/status; then echo "Playing" ; else echo "Idle"; fi It works nicely in the ...
user avatar
2 votes
1 answer
1k views

How to make Android Amoled screen to display colours for hardware testing, through commands?

In hardware testing i want to display colours like red, green, blue etc.., on the android screen i.e., Amoled display. Can you help to do this through commands and how the invoke the android display ...
user avatar
0 votes
0 answers
590 views

Rooted phone no root access in bash but sh

on cm 12.1 (I know the nightlies) I experienced something very curious. at first, if I start a terminal emulator, I'm not root. I'm just the user the app is running in. so if I do echo $USER it ...
user avatar
0 votes
1 answer
466 views

Android Tethering - Shell To Python Code (SL4A API)

I know I can convert how I call an activity from within a shell to python code. So given the correct code can someone help me in that conversion? I know I can use pyjinus so that should be another ...
user avatar
2 votes
1 answer
395 views

defining functions in TWRP

In "normal" android you start up a Terminal emulator or do "adb shell" and then from there you can defining a function by: function name { #code } name #runs "name" But by using adb shell over TWRP ...
user avatar
0 votes
2 answers
2k views

How to display Python script output on screen, similarly to Conky

I use Conky as a desktop monitoring software. I also use it to monitor stock prices and portfolio net worth through a Python script. Basically, I fetch the stock prices from Yahoo Finance using curl....
user avatar
3 votes
3 answers
1k views

Work-around for process substitution in mksh

An extremely useful feature of Bash, known as process substitution, is missing in the Android shell, mksh. This is highly unfortunate as it prevent you from doing things like: diff <(sort list1) &...
user avatar
  • 817
2 votes
1 answer
5k views

How to query/change the default gateway via bash on CM12?

When i do a 'busybox route' on CM12 i get this: localhost / # busybox route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.100.0 * ...
user avatar
  • 88
0 votes
1 answer
703 views

Error opening terminal: Screen

I just installed nano on my Nexus 9, which is rooted. However, when I try to run nano, it says "Error opening terminal: screen." bash-3.2# nano Error opening terminal: screen. Any help would be ...
user avatar
3 votes
1 answer
128 views

How much control can I have over my device while not voiding the warranty?

I'm a developer and a Linux user, so naturally, I want to install a Bash prompt on my device. There are several Bash "apps" available in the Google Play store (haven't tested any of them, just ...
user avatar
  • 149
0 votes
1 answer
885 views

SH Script to Rename .apk.odex files

I have written a script to utilize dexopt-wrapper to odex a folder of .apk's #!/bin/sh SYSAPP=/mnt/extSdCard/FilesToOdex/system/app/ SYSPRIVAPP=/mnt/extSdCard/FilesToOdex/system/priv-app/ for i1 in ...
user avatar
  • 209
2 votes
1 answer
853 views

I can reverse tether now by using alias but it stops on adb shell command

I made some aliases to quickly reverse tether. alias t='r && sh && n' alias n='netcfg rndis0 dhcp' alias sh='ad shell' alias r='ad kill-server && ad start-server' alias ad='...
user avatar
  • 557
1 vote
1 answer
525 views

Bash-Shell on Android Tablet (Transformer Pad TF701T)

Is there any way to get a fully working bash shell on Android together with a terminal emulator, that supports a hardware keyboard (German Layout)? The features I need at least (Terminal Apps, NOT ...
user avatar
  • 213
0 votes
0 answers
1k views

sound alarm from terminal emulator

For my purposes, I want to create a simple bash script, that will notify me when appropriate conditions will meet. Is there a way to make a sound alert from Android Terminal Emulator? I'm running ...
user avatar
  • 101
6 votes
2 answers
27k views

How do I open a text file from a terminal window from within the Android GUI?

I'm trying to open a text file from within a terminal window emulator -- but not so it opens in the actual terminal but more like I've just clicked on it. So my question is: What command can I use to ...
user avatar
1 vote
4 answers
6k views

Home screen icon for terminal program?

I'm using terminal-ide http://code.google.com/p/terminal-ide/ which is basically a terminal for android with all sorts of utilities. One is able to create bash scripts for example. Is there a way to ...
user avatar
1 vote
1 answer
2k views

Bash terminal on tablets

I would like to buy a tablet and use it as a netbook to work using a keyboard dock (I still like the touchscreen and stylus options over buying a netbook). I work mostly on linux machines where I need ...
user avatar
10 votes
2 answers
44k views

adb "Permission denied" to run a "./configure" file

I need to run a configure file into my android phone so I think the best way to do this is to use the adb shell command. I'm running an Android emulator onto a Windows-7 platform, and there I'm ...
user avatar
8 votes
4 answers
13k views

Running applications from a terminal emulator [closed]

I have a rooted Nexus 7 Jelly Bean tablet and whenever I attempt to run an application from a terminal emulator app after chmod 777ing it and using the syntax ("./applicationName") it insists that I ...
user avatar
1 vote
0 answers
615 views

Install Bash on rooted Kindle Fire

I just rooted my Kindle Fire and installed QuickSSHd, an SSH daemon app. I can log in via SSH (using Putty in Windows 7) and become root, etc. It appears, however, that the only shell installed is ...
user avatar
12 votes
5 answers
11k views

How to set bash as default shell?

When I adb into a device with Cyanogenmod, I'm presented with a nice bash shell, color prompt, and bashrc. I don't see a symlink from /system/xbin/bash to /system/bin/sh. How do they set the default ...
user avatar
  • 221
14 votes
3 answers
17k views

Command to install app from phone?

I'd like to SSH into my phone, download an APK, and install it remotely. Is there a command available on the phone that would allow me to do this? EG: wget localhost/file.apk android_install file....
user avatar
  • 2,492
5 votes
4 answers
2k views

bash - How can I check if a computer exists on my network WITHOUT IP (i.e. by device name only)?

I would like my phone to execute certain shell scripts via Tasker if my phone is on the same wifi network as my laptop. My initial idea is to edit the /etc/hosts file, but this wouldn't work since ...
user avatar
  • 253
1 vote
1 answer
3k views

How to modify Bash shell prompt in Cyanogenmod?

Has anyone had any success modifying the shell prompt in Cyanogenmod? Presently, # is pretty useless, it would be much nicer to at least display the working directory. Also, is tab-completion possible?...
user avatar
  • 2,492
5 votes
2 answers
382 views

Is it possible to start an FTP session via bash?

Is it possible to start a session with an Android Samsung Galaxy smartphone through a bash shell to access files remotely?
user avatar