Showing posts with the label Shell Scripts

Connect to Postgres Database in Unix Shell Script

Q) How to connect to postgres database from unix shell or bash script and run sql queries? The postgres command line utility, psql, can b...

Check if a Directory Exists in Shell Script - Unix

How to check whether a directory exists or not in unix or linux shell script? I want to check for the directory existence in the shell sc...

Assign output of Shell Command To variable - Bash script

How can one assign the output of the shell command to a variable in bash script under unix and linux like operating systems. Bash provid...

File Test Operators / Operations Examples in Unix / Linux Shell Script

In linux and unix operating systems every thing is a file. When you are using files in your shell or bash script, it is a good idea to do ...

Arithmetic Operations / Expressions in Unix / Linux Bash Script

Unix or linux operating systems provides the bc and expr commands for doing arithmetic calculations. In this article, we will see how to do...

Read command line arguments - Unix / Linux Bash Script

Q) How to read the arguments or parameters passed to a shell script from the command line? In general the command line arguments are pass...

Find Length of String in Unix / Linux Bash Script

Q) How to find the length of the given string in unix or linux operating system? Length of the string is the number of characters in the ...

Execute Mysql Command in Bash / Shell Script

Q) How to connect to mysql database from a bash script in unix or linux and run sql queries? Bash scripting helps in automating things. W...

How to Find Prime Number Bash (Shell) Script in Unix / Linux

Q) How to find whether the give number is prime number or not using the bash script in unix or linux system? A prime number is the one wh...

Grep Command in Unix Shell script

Q) How to use the grep command in unix or linux bash scripts to search for a pattern match? You might have used the grep command to searc...

Bash Shell Script to Read / Parse Comma Separated (CSV) File - Unix / Linux

Q) How to parse CVS files and print the contents on the terminal using the bash shell script in Unix or Linux system? It is the most comm...

Connect to Oracle Database in Unix Shell script

Q) How to connect to oracle database and run sql queries using a unix shell script? The first thing you have to do to connect to oracle d...

Load More That is All