≡ Menu

BASH Shell

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 Shell: Convert Tabs To Spaces In a File

How do convert tabs to spaces in a file using a bash shell?
[click to continue…]

HowTo: Linux Rename Files

How do I rename a file under Linux operating systems using command line (bash shell prompt)?
[click to continue…]

Linux: Change the PATH [ Add New Directory ]

How do I change the PATH settings under Linux operating systems and add a new directory to $PATH under bash shell?
[click to continue…]

Linux: Parse an IP Address

How do I parse my Linux servers IP address using a Bash shell?
[click to continue…]

Redhat Linux: Find Out My IP Address

How do I to find out ip address on a CentOS or Fedora or Redhat Enterprise Linux server or desktop system using bash shell or command line options?
[click to continue…]

HowTo: Linux / UNIX Unset TMOUT ( AutoLogOut )

I've set the the TMOUT in the ~/.profile of the user account as well as in /etc/profile file on my UNIX or Linux servers. How do I unset the TMOUT variable? How to unset TMOUT temporarily under UNIX like operating systems?
[click to continue…]

HowTo: Unix For Loop 1 to 100 Numbers

I want to run a Unix command 100 times using a for loop from 1 to 100. Can you tell me how to take a block of numbers in a loop under KSH or BASH shell?
[click to continue…]

Linux / UNIX: Generate Passwords

How do I generate random passwords under Linux / UNIX / Mac OS X and *BSD operating systems?
[click to continue…]

Use BASH nullglob To Verify *.c Files Exists or Not In a Directory

Can you explain me usage of nullglob variable under BASH? How do I check for any *.c files in any directory?
[click to continue…]