Skip to content

Tag: bash

Why does tar -c command remove leading `/’ from member names

Looking to find the practical reasons the command tar -c /filea > /fileb gives the following output: tar:Removing_leading / from member names. I have researched it quite a bit but only come across very vague reasons such as protects against some sort of attack etc. The majority just give explanations on a …

Generating systematic incremental numbered filenames in Bash

I have a random number of files with names as: Note that the number of .txt files varies in different directories. For example, a directory may contain only one id_1000.txt (at least) or may contain any number of files with any higher number of digits. To convert the random number of filenames in systematic i…

Shell script works in bash but not on ‘adb shell’

Below shell script works perfectly fine in bash shell. But produces an error in android shell. May be it has got to do something with the shell that android is using. But how can I resolve it? If not a perfect solution, an hack would also do for me. Shell-script : O/p In android shell, O/p on bash shell(Linux…

How to store value from grep output in variable

I am working on one bash script, in which I have to use the regular expression to match string and then store the output in a variable to reuse it. here is my script, I tried this many ways, but I am getting error : ./check.sh: MET-3-get-issue-id-from-branch-name: not found if I run individual grep command th…

qt run shell commands via qprocess

I am developing a small QT application to interact with the terminal, to send commands to the terminal and to read back information printed out. Example: get output of all processes using ps -aux PROBLEM I am able to write information out to the terminal but I dont think it is in the system scope, actual exam…