tagged [shell]

How do you normalize a file path in Bash?

How do you normalize a file path in Bash? I want to transform `/foo/bar/..` to `/foo` Is there a bash command which does this? --- Edit: in my practical case, the directory does exist.

25 Sep at 12:4

How to parse XML in Bash?

How to parse XML in Bash? Ideally, what I would like to be able to do is:

29 May at 03:30

Execute a file with arguments in Python shell

Execute a file with arguments in Python shell I would like to run a command in Python Shell to execute a file with an argument. For example: `execfile("abc.py")` but how to add 2 arguments?

16 Jan at 15:59

Escape double quote in grep

Escape double quote in grep I wanted to do grep for keywords with double quotes inside. To give a simple example: That does not match. How can I fix it?

7 Dec at 20:42

How do I assign ls to an array in Linux Bash?

How do I assign ls to an array in Linux Bash? I have three directories: `ww` `ee` `qq`. I want them in an array and then print the array.

19 Feb at 00:6

Using sed, how do you print the first 'N' characters of a line?

Using sed, how do you print the first 'N' characters of a line? Using `sed` what is an one liner to print the first ? I am doing the following:

13 Jan at 13:42

How to detect running app using ADB command

How to detect running app using ADB command I have one Android Device running Jelly Bean OS. Is there any way to detect the process is running or not using `ADB` command if i know the ?

22 May at 12:21

How to run a python script from IDLE interactive shell?

How to run a python script from IDLE interactive shell? How do I run a python script from within the IDLE interactive shell? The following throws an error:

16 Feb at 16:46

How to create a database from shell command?

How to create a database from shell command? I'm looking for something like createdb in PostgreSQL or any other solution that would allow me to create database with a help of a shell command. Any hint...

1 Oct at 12:26

Convert absolute path into relative path given a current directory using Bash

Convert absolute path into relative path given a current directory using Bash Example: How do I create the magic (hopefully not too complicated code...)?