I want to download all files from /data/data/foo folder to my pc. I am using adb to connect with my phone. To download files I am using: And here’s response: And in fact, only this is copied: What I am doing wrong here? Answer The problem: What you’re doing is right (the command is correct), but t…
Tag: bash
In output, echo command printed new line when after printed variable
This is my small bash script code and i want to print the number of files created in the directory : My expected output is : but i got the below output: can you help what went wrong in my above code? Also please suggest if this is the correct way to print the number of files in the directory
Piping two command from makefile is not working
I use the following commands in my makefile in the commands im getting array of values and remove the array [] from it, I want to run this command in my terminal and I use the following fzr provide apps | (subst ],,$(subst [,,$(apps))) | $(apps) and I got error what am I missing here ? if I run only
I need a linux script to report all error lines from a log file, and export the results of error lines into a .csv file? [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago. Improve this question I have log file for checking transactions, and I have error lines, so I ne…
ls sort order inside container
Running ls -d to list directories, print directories in different order if trailing / is present in file name. Why is that? What sorting rules apply? and why does this happen only with docker? With trailing / Without trailing / Answer I found out I get the same behavior using sort command But the sorting orde…
Replacement of PS1 variable in .bashrc using Sed or Perl
I am trying to replace a line in file and am running in to issues. Original File: Command I am running: Error message: I also tried sed: Result with Sed: Expected Result File: End Result This doesn’t have much to do with the question except to show folks what the PS1 will look like when working properly…
bash script unable to ask confirmation
I am initiating myself to shell scripting and I need to ask the user about confirmation. I have this script, which I don’t know why the following command is not working: read -p “Are you sure about this action?” yn I use it twice, at the beggining of the script and in the middle. The first r…
Export Curl information to file using sed
I am trying to get a dns address using curl and I would like to use that dsn address to replace a word in a .js file. So the .js file contains a word “hostname” and I would like to replace that with the dns address fetched from curl so what I am trying to do is this. sed ‘s/hostname/curl
Bash get docker image ID automatically
I’m trying to run a few docker commands in my linux machine: But I would like to make a runme.sh and execute all in one run. The problem is that ImageID bf46cff9b182 is dynamiccally changing everytime. So I need to somehow pipe it from the output of the load command, which is in fact possible. The outpu…
Can I omit the full path of a “shebang” on the first line of shell script?
I often see #!/usr/bin/env bash at the first line of shell scripts. It seems to work fine to omit /usr/bin/ part on macos: Can I do that on all other Unix-like platforms? Answer Using interpreter without full path is not supported everywhere. In many cases, kernel does the shebang handling and kernel normally…