≡ Menu

command line args

UNIX: Loop Through Files In A Directory

How do I loop through files in a directory under UNIX like operating systems?
[click to continue…]

xargs: How To Control and Use Command Line Arguments

I am trying to use xargs command using shell pipes and not able to understand how to control and use command line arguments. For example I'd like to find out all *.c file located in 100s of sub-directories and move them to another directory called ~/old.src. How do I use command line args with xargs to achieve the same?
[click to continue…]

Pass Command Line Arguments To a Bash Alias Command

How do I pass all command line args to my bash alias called foo. For example:

alias foo="/path/to/command $@"

However $@ get interpreted when creating the alias instead of during the execution of the alias and escaping the $ doesn't work either. How do I solve this problem?
[click to continue…]

Perl Display And Pass Command Line Arguments With @argv

How do I read or display command-line arguments with Perl?
[click to continue…]