≡ Menu

shell scripting

FreeBSD: Install zsh Shell

How do I install the Z shell ( zsh ) shell under FreeBSD 9 operating systems?
[click to continue…]

Bash: Assign Output of Shell Command To Variable

How do I assign the output of a shell command to a shell variable under Unix like operating system? For example, I want to store the date command output to a variable called $now. How do you do that?
[click to continue…]

HowTo Run a Script In Linux

How do I run a Linux shell script? How can I run a script in Linux operating system using command line options?
[click to continue…]

Howto: Call Shell Script function In echo statement

I need to call the function called foo() using echo command in the same statement. How do I all or invoke the function using the echo statement?
[click to continue…]

Bash String Concatenation

How do I join two strings under BASH? I have two strings stored in two different variables (_p=/delta and _u=aqua) and how do I join this and assign it to another variable in bash?
[click to continue…]

UNIX / Linux: Deleting Multiple Files In Bulk

How do delete multiple files in bulk (say all *.bak file stored in /netapp/ and its subdirectory) under Linux / UNIX operating systems?
[click to continue…]

UNIX Source Command: Read And Execute Commands From File

What is the use of UNIX source command under bash or any other shell? How do I use source command under UNIX / OS X / Linux operating systems?
[click to continue…]

Bash Shell Read a Line Field By Field

How do I read a file field-by-field under UNIX / Linux / BSD Bash shell? My sample input data file is as follows:


For each line I need to construct and execute a shell command as follows:
/path/to/deviceMaker --context=$1 -m $permissions $device2 $deviceType $major $minor
[click to continue…]

Bash: Continue In a For / While Loop

How do I continue in a for or while loop in Bash under UNIX or Linux operating systems?
[click to continue…]

Ksh Read a File Line By Line ( UNIX Scripting )

How do I read a file line by line using KSH shell scripting under UNIX like operating systems?
[click to continue…]