Passing wildcard parameters to find via a variable
I have a script to fix permissions which is made up of blocks like:
That fragment works as expected, but no matter what I try I cannot get the following to work:
Without using an array to store the prune parameters it works on the command line and in a script, so there is nothing wrong with the find command itself. But when using the array it is matching hidden files.
I have tried different levels of escaping in case I needed to also escape the slash, but it made no difference.
Also I have tried using escaped single quotes, and running the script in sh and bash modes. The only difference with the latter was a single escaping slash in bash mode causes the wildcard to expand, the same as if no slash was used.
I want to use a variable to hold these parameters though as they are repeated on other find commands for file permissions and ownership, so any help on how to get this to work would be appreciated.
It is always something simple! I probably should quote everything anyway to be safe, I do have files with spaces, but just quoting the ${FS_EXCLUDE[@]} variable was the missing piece to make the script work.
I am struggling to see the logic of why it makes a difference, though, as surely when the array elements are unpacked they would be within the quotes and so passed as a single parameter?
Hello Experts,
I have a requirement to pass some parameters to Linux cron tab.
For ex: My default cron entry looks like this as below:
-------------------------------
55 10 * * --... (7 Replies)
Hi,
I have file in my $datadir as below :-
SAT_1.txt
SAT_2.txt
BAT_UD.lst
BAT_DD1.lst
DUTT_1.txt
DUTT_la.txt
Expected result :-
should get all the above file in $<Filename>_file.lst
Below is my code :-
for i in SAT BAT DUTT
do
touch a.lst
cd $datadir (1 Reply)
we are using following script to execute stored procedue. The problem is run_pmcmd.ksh script is using $*
parameter which is not taking in account 'Men Shirt' parameter which includes spaces.
1. Step 1
run_pmcmd.ksh CONVERT_TEST
script for run_pmcmd.ksh
/u01/$(whoami)/run_pmcmd.ksh... (11 Replies)
how can i make a script to run only when parameters are given,
if parameters are not given it should through an error , saying "please enter a parameter"
for ex: i want a find command to run only when the parameters are given (4 Replies)
Hi There
I am new to scripting and require some assistance please.
I am trying to define a variable with a wildcard in a shell script (.ksh) that will be run on AIX 5300-10.
The variable I am trying is:
FILES=LLA_*.CSVWhen I run the following section of the script:
scp... (2 Replies)
I am trying to execute a copy command via shell script. However, on occassion, 2 or more files need to copied. How do I code for the multiple arguments? Does it matter how the files are delimited?
Example: I have a script to copy files from 1 dir to another called duplicate.csh
In most... (1 Reply)
Please help me how to pass some unix vairable to oracle. I have used below , but not displaying passed (inval) value.
calling()
{
sqlplus -s $1/$2@$3 <<EOF
begin
exec call_sql($4);
end;
exit
EOF
}
calling user pwd inst value1... (17 Replies)
hi,
i am passing around 14 parameters for a script
a=$1
b=$2
c=$3
d=$4
e=$5
f=$6
g=$7
h=$8
i=\"${9}\"
shift
j=\"${1}\"
still for j it is displaying the 1st parameter value..how to make it take the 10th parameter (2 Replies)
I have 2 scripts: script1 and script2
Script1 passes 4 parameters to script2 as follows
#script1
code
...
...
script2 $var1 $var2 $var3 $var4
Script2 uses the export command to know to expect these values
#script2
export $1 $2 $3 $4
code
...
...
The problem that I am having is... (1 Reply)
I'm trying to figure out how to build a small shell script that will find old .shtml files in every /tgp/ directory on the server and delete them if they are older than 10 days...
The structure of the paths are like this:
/home/domains/www.domain2.com/tgp/
/home/domains/www.domain3.com/tgp/... (1 Reply)