APPLY(1) BSD General Commands Manual APPLY(1)NAME
apply -- apply a command to a set of arguments
SYNOPSIS
apply [-a c] [-d] [-#] command argument ...
DESCRIPTION
The apply utility runs the named command on each argument argument in turn.
Character sequences of the form ``%d'' in command, where 'd' is a digit from 1 to 9, are replaced by the d'th following unused argument. In
this case, the largest digit number of arguments are discarded for each execution of command.
The options are as follows:
-# Normally arguments are taken singly; the optional number -# specifies the number of arguments to be passed to command. If the number
is zero, command is run, without arguments, once for each argument.
If any sequences of ``%d'' occur in command, the -# option is ignored.
-a c The use of the character '%' as a magic character may be changed with the -a option.
-d Display the commands that would have been executed, but do not actually execute them.
ENVIRONMENT
The following environment variable affects the execution of apply:
SHELL Pathname of shell to use. If this variable is not defined, the Bourne shell is used.
FILES
/bin/sh default shell
EXAMPLES
apply echo *
is similar to ls(1);
apply -2 cmp a1 b1 a2 b2 a3 b3
compares the `a' files to the `b' files;
apply -0 who 1 2 3 4 5
runs who(1) 5 times; and
apply 'ln %1 /usr/joe' *
links all files in the current directory to the directory /usr/joe.
HISTORY
The apply command appeared in 4.2BSD.
AUTHORS
Rob Pike
BUGS
Shell metacharacters in command may have bizarre effects; it is best to enclose complicated commands in single quotes ('').
The apply utility does not recognize multibyte characters.
BSD December 13, 2006 BSD
Check Out this Related Man Page
APPLY(1) BSD General Commands Manual APPLY(1)NAME
apply -- apply a command to a set of arguments
SYNOPSIS
apply [-ac] [-#] command argument ...
DESCRIPTION
apply runs the named command on each argument argument in turn.
Character sequences of the form ``%d'' in command, where ``d'' is a digit from 1 to 9, are replaced by the d'th following unused argument.
In this case, the largest digit number of arguments are discarded for each execution of command.
The options are as follows:
-# Normally arguments are taken singly; the optional number -# specifies the number of arguments to be passed to command. If the number is
zero, command is run, without arguments, once for each argument.
If any sequences of ``%d'' occur in command, the -# option is ignored.
-ac The use of the character ``%'' as a magic character may be changed with the -a option.
ENVIRONMENT
The following environment variable affects the execution of apply:
SHELL Pathname of shell to use. If this variable is not defined, the Bourne shell is used.
FILES
/bin/sh Default shell
EXAMPLES
apply echo *
is similar to ls(1);
apply -2 cmp a1 b1 a2 b2 a3 b3
compares the `a' files to the `b' files;
apply -0 who 1 2 3 4 5
runs who(1) 5 times; and
apply 'ln %1 /usr/joe' *
links all files in the current directory to the directory /usr/joe.
HISTORY
The apply command appeared in 4.2BSD.
AUTHORS
Rob Pike
BUGS
Shell metacharacters in command may have bizarre effects; it is best to enclose complicated commands in single quotes ('').
BSD April 4, 1994 BSD
lets say i have a command with arguments i.e.
alt_disk_install -C hdisk1
the argument being hdisk1
this could be differnt depending on what server your on
how could i have this be a variable that refers to this value in a file
something like
alt_disk_install -C valueinfile
... (4 Replies)
Is there a command that will return the name of the largest file within a directory? If so, can I set the returned filename into a variable? (4 Replies)
Hello All,
I want to build some monitoring of processes in HP-UX 11.x.
Is there any way to get the whole set of commands and arguments instead of the first 60 characters? I read that there's a limitation of the ps -ef command that we can't overcome. In this case is there any other command... (17 Replies)
hello
Please tell me the command to sort files in specific directory
i have several files in one directory the files names are
2006-01-25
2006-01-23
2006-01-08
2006-01-07
I WANT TO DISPLAY FILES DATEWISE . THE LATEST DATE SHOULD BE FIRST FILE AND OLDEST WILL BE LAST ONE
PLS... (10 Replies)
how to list all files in current directory whose second character is a digit.
i guess i hav to use grep command + ls for this. but dont know how to use? (6 Replies)
Is there any command which I can apply from the command line to find and replace a particular text say "00:00:00:00" with "00" from all the files( where ever this text exists) of the current directory? (17 Replies)
I have a directory of files and each file has a random 5 digit string at the beginning that needs to be removed. Plus, there are some files that will be identically named after the 5 digit string is removed and I want those eliminated or moved.
any ideas? (17 Replies)
I have say 100 text files (with .txt extension) in a directory.
An example of the content in the file is given below
"NAME"
"cgd1_200"
"cgd1_3210"
"cgd1_560"
"cgd2_2760"
"cgd2_290"
"cgd3_3210"
"cgd3_3310"
"cgd3_660"
"cgd5_2130"
"cgd5_4080"
"cgd6_3690"
"cgd6_4480"
"cgd8_1540"... (2 Replies)
Does anybody know how to Accept a “userid” as a command line argument on a Unix Bourne Shell Script?
The output should be something like this:
User userid has a home directory of /path/directory
the default shell for this user is /path/shell (5 Replies)
Let's say I want to print the arguments $4 till $#, how can I do this?
$# contains the number of arguments
$@ contain all the arguments as string
What i need is something like
for i in $4_till_$#; do
#do something with $i
convert $i ~/$output
done
The first 3 arguments are used as options... (6 Replies)
I have folders like as below format. I need to apply the 755 mode for '.sh' format only. I am using the below command to apply the changes. But it's affecting first level only. How to apply the changes recursively in .sh file only?
Please suggest the command.
Thanks
chmod 755 -R *.sh
... (8 Replies)
Gooday
I have an argument string that contains 15 arguments.
The first 14 arguments are easy to handle because they are separated by spaces
ARG14=`echo ${ARGSTRING} | awk '{print $14}'`
The last argument is a text that may be empty or contain spaces. So any ideas on how I get the last... (23 Replies)
Write a Unix shell script named 'mode' that accepts two or more arguments, a file mode, a command and an optional list of parameters and performs the given command with the optional parameters on all files with that given mode.
For example, mode 644 ls -l should perform the command ls -l on all... (5 Replies)