简体   繁体   中英

Scripting in Android with terminal emulator

I was a beginner in Linux. And I had no Computer when I wrote this. I used terminal emulator on my Android to run Linux commands. I installed Busybox too. I also had root access.I tried to execute a shell script "sample.sh". The terminal opens but the file was not executed. So I asked "What is the .bat equivalent extension in linux?".

Is this really a very bad question? What was the point in downvoting the question here? I clearly mentioned what I have tried and What happended. And that genuine downvoter never explained the reason. Is this the correct way to treat a newbie. With lots of hatred from my various questions, I lost hope and never used SO

So if there is still hope. Can anyone justify the actions?

The equivalent extension is .sh , but you also need the correct shebang line. The first line of a unix script is examined to determine the magic number - you want something like

#! /usr/bin/env bash

And the file needs to have the executable bit set,

chmod a+x file.sh

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM