≡ Menu

ksh

I'm writing a bash wrapper script that will pass arguments to the command. I need to find out the last argument if I call the wrapper as follows:

./wrapper -a -b --longarg=foo thisfilename.txt
./wrapper -a -b thisfilename.txt
./wrapper -a --next=true thisfilename.txt

Where,
=> $@ is all of them.
=> $0 is script name.
=> $1 is first arg.

I want thisfilename.txt stored in a shell variable called $last. How do I find the last argument passed to a shell script written in bash or ksh under Unix like operating systems?
[click to continue…]

Unix Copy Command Examples [ cp command ]

How do I copy files under Unix operating system using ksh or csh or bash shell prompt?
[click to continue…]

FreeBSD: Install zsh Shell

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

I'm using a Mac OS X and combination of ssh-agent+ssh-add to adds RSA or DSA identities to the authentication agent. ssh-agent provides me a secure way of storing the private key. However, I'd like to expire identities added to the agent within half an hour. How do I set lifetime of identities added to the agent under Unix / Linux / BSD / Apple OS X operating systems?
[click to continue…]

How do I run "foo" command 10 times (or n times) under Linux or UNIX like operating systems?
[click to continue…]

I have a file of that looks as follows:

foo bar
tom jerry
UNIX Linux

Each word and/or Linux is a different length. How do strip or remove the last character from each line using bash or ksh shell only on a Linux or Unix-like systems?

Tutorial details
DifficultyEasy (rss)
Root privilegesNo
RequirementsNone
Estimated completion time2m

[click to continue…]

How do I change the default home page with Lynx browser under UNIX or Linux operating system? How do I set the startup page to http://google.co.uk with Lynx?
[click to continue…]