tagged [shell]

How do I check if a directory exists or not in a Bash shell script?

How do I check if a directory exists or not in a Bash shell script? What command checks if a directory exists or not within a Bash shell script?

27 Jan at 23:14

How to reload .bashrc settings without logging out and back in again?

How to reload .bashrc settings without logging out and back in again? If I make changes to `.bashrc`, how do I reload it without logging out and back in?

3 Jan at 22:4

How to get the contents of a webpage in a shell variable?

How to get the contents of a webpage in a shell variable? In Linux how can I fetch an URL and get its contents in a variable in shell script?

19 Sep at 14:2

Running windows shell commands with python

Running windows shell commands with python How can we interact with OS shell using Python ? I want to run windows cmd commands via python. How can it be achieved ?

15 Feb at 11:29

I get "dquote>" as a result of executing a program in linux shell

I get "dquote>" as a result of executing a program in linux shell When I execute a script in a Linux shell, I get this output: What does this mean?

25 Jan at 17:53

What does "-ne" mean in bash?

What does "-ne" mean in bash? What does the command "-ne" mean in a bash script? For instance, what does the following line from a bash script do?

20 Mar at 03:21

How do I read user input into a variable in Bash?

How do I read user input into a variable in Bash? How do I read user input into a variable in Bash? ``` fullname="" # Now, read user input into the variable `fullname`. ```

19 Oct at 21:30

Associative arrays in shell scripts

Associative arrays in shell scripts We require a script that simulates associative arrays or map-like data structure for shell scripting. Can anyone let's know how it is done?

Execute shell command from within a MySQL client?

Execute shell command from within a MySQL client? In oracle database, command "host" can be used to run bash command from database command window. Is there a equivalent command as "host" in mySql?

31 Jan at 19:13

Shell: How to call one shell script from another shell script?

Shell: How to call one shell script from another shell script? I have two shell scripts, `a.sh` and `b.sh`. How can I call `b.sh` from within the shell script `a.sh`?

22 Oct at 12:51

Select random lines from a file

Select random lines from a file In a Bash script, I want to pick out N random lines from input file and output to another file. How can this be done?

11 Apr at 05:24

How do I execute a program or call a system command?

How do I execute a program or call a system command? How do I call an external command within Python as if I had typed it in a shell or command prompt?

How can I debug a Bash script?

How can I debug a Bash script? Is there a way to debug a Bash script? E.g., something that prints a sort of an execution log, like "calling line 1", "calling line 2", etc.

25 Oct at 17:30

How to view files in binary from bash?

How to view files in binary from bash? I would like to view the contents of a file in the current directory, but in binary from the command line. How can I achieve this?

5 Dec at 22:36

How do you run a script on login in *nix?

How do you run a script on login in *nix? I know I once know how to do this but... how do you run a script (bash is OK) on login in unix?

8 Apr at 19:9

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...)?