Try changing:
to:
Double quotes should also work as well as single quotes in this example. (I generally prefer single quotes when quoting constant strings.)
PS
I should have said why the quotes are needed...
The unquoted argument [:digit:] is a pathname bracket expression that changes to a list of files with the single character names :, d, i, g, and t if any such files are present in the directory where you run this command. If you run it in a directory where there are no files matching this pattern, the unchanged pattern is passed to tr as an operand. So, the reason it works sometimes and fails sometimes is the contents of the directory where it is run; not the script used to invoke it.
Last edited by Don Cragun; 01-10-2015 at 12:41 AM..
Reason: Add PS.
This User Gave Thanks to Don Cragun For This Post:
Hi All,
can anyone tell me what is wrong with this command.
tail -f /opt/olr-logs/PaymentGateway.log | grep "DEBUG - Start! AkhtarPaymentGateway - generateChecksum" | awk '{print $13}' | sed 's/,//g'>> abc
But I found nothing in the file abc
Please do help me.or Provide me some... (8 Replies)
i am trying to find the files which are more than 100MB and it was created 10 days ago.
find /lola/loaded -size +102400 -mtime -10 -print | xargs ls -ltr
-rw-rw-r-- 1 lola_adm gdrmp 82054170 Jun 23 06:17 /lola/loaded/ILMEMBER20090622.txt
-rw-rw-r-- 1 lola_adm gdrmp 652080494 Jun 24... (3 Replies)
Hello,
I try to using the below command to find out all the datafiles under "sja"
direcotory.
$ xargs -i find {} -type f -ls < sja
/bin/ksh: sja: cannot open
so can you tell me what is wrong?
Thanks
Jerry (3 Replies)
Hi all,
I'm trying to run the following command to get all files in one directory to another with the files' timestamps preserved,
cp -p /logs/dvgbiau/batch/* /logs/dvgbiau/tmp_batch
Note that ./batch and ./tmp_batch are two sub-directories under /logs/dvgbiau.
The error was,... (1 Reply)
hi Alll,
I want to install solaris 10 on exixting solaris mahcine.
I tried for OK boot cdrom-install
but it gave me fatal error - disk not bootable , boot command disable
so i tried with
ok setenv auto-boot? false
Ok reset-all
after this server rebooted automatically and... (2 Replies)
I am facing strange problem where after three failed login attempt user password must be locked. Actually what is happening, when I take the putty session of the server & enter user name on the prompt at the login prompt & then press enter to enter the password at this time when I checked the... (10 Replies)
The below code usually works when the value for the COLUMN variable is numerical. but im in a situation where the number of fields in a file is not definitive. it changes.
but what is static is that the value i want to retrieve from the log is 3 fields from the last field. which is what i... (9 Replies)
Discussion started by: SkySmart
9 Replies
LEARN ABOUT MOJAVE
apply
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.
EXAMPLES
apply echo a*
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.
FILES
/bin/sh default shell
AUTHORS
Rob Pike
BUGS
Shell metacharacters in command may have bizarre effects; it is best to enclose complicated commands in single quotes ('').
HISTORY
The apply command appeared in 4.2BSD.
BSD April 4, 1994 BSD