find is not shell, it does not expand * inside commandlines. It does inside -name and -path arguments however.
\ is taken literally inside single quotes anyway, so probably won't do what you want it to do.
I don't think find can do everything you want all by itself, but it can at least find the names for you, and print them one-by-one. Shell can do the rest.
Remove the 'echo' once you've tested and are sure it does what you want.
Last edited by Corona688; 01-11-2013 at 04:44 PM..
cat .servers | while read LINE; do
ssh jason@$LINE $1
done
exit 1
./command.ksh "ls -l ~jason"
Why does this ONLY iterate on the first server in the list? It's not doing the command on all the servers in the list, what am I missing?
Thanks!
JP (2 Replies)
Howdie everyone...
I have a shell script RemoveFiles.sh
Inside this file, it only has two commands as below:
rm -f ../../reportToday/temp/*
rm -f ../../report/*
My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Hello, the ls -d command to only list directories in a directory doesn't seem to work on Solaris and the man command says to use that combination: ls -d
Anyone have the same problem and find a resolve?
Thanks
BobK (9 Replies)
Hi. I've been playing around a bit. This isn't for any practical purpose-- it's really just a theoretical exercise. I wrote this little thing:
foreach num ( 6 5 4 )
awk -v "number=$num" 'BEGIN{for(x=0;x<$number;x++) printf "-"; printf "\n"}'
end
I would expect the following output:
... (3 Replies)
Hi
I have put alias ll='ls -la' in .profile file but it doesn't work.
On hand it works it looks like the .profile file is not beeing read.
How to check whitch file is loaded? ,profile? .bash_profile?
My system: SunOS mion 5.10 Generic
Shell: /bin/pfksh
Thanks (2 Replies)
i want to get the value for column 4rth when i =4. please guide what i am doing wrong. thanks
var=`cat file.csv`
for i in $var; do {
if ; then
var4=$var4+$i
fi
echo $i
}
done
I am geting this error message "0403-009 The specified number is not valid for this command." (8 Replies)
I edited sudoers like this:vi /etc/sudoers
subex ALL =(root) NOPASSWD: /usr/ccs/bin/pstack
But the respective user still is prompted for password, and even when the right password is used, the command is still not launched.$sudo usr/ccs/bin/pstack 26557
We trust you have received the usual... (5 Replies)
Hi,
I am using korn shell.
until ]
do
echo "\$# = " $#
echo "$1"
shift
done
To the above script, I passed 2 parameters and the program control doesn't enter inside "until" loop. If I change it to until ] then it does work.
Why numeric comparison is not working with -ne and works... (3 Replies)
Discussion started by: ab_2010
3 Replies
LEARN ABOUT PHP
unset
UNSET(3) 1 UNSET(3)unset - Unset a given variableSYNOPSIS
void unset (mixed $var, [mixed $...])
DESCRIPTION unset(3) destroys the specified variables.
The behavior of unset(3) inside of a function can vary depending on what type of variable you are attempting to destroy.
If a globalized variable is unset(3) inside of a function, only the local variable is destroyed. The variable in the calling environment
will retain the same value as before unset(3) was called.
<?php
function destroy_foo()
{
global $foo;
unset($foo);
}
$foo = 'bar';
destroy_foo();
echo $foo;
?>
The above example will output:
bar
To unset(3) a global variable inside of a function, then use the $GLOBALS array to do so:
<?php
function foo()
{
unset($GLOBALS['bar']);
}
$bar = "something";
foo();
?>
If a variable that is PASSED BY REFERENCE is unset(3) inside of a function, only the local variable is destroyed. The variable in the
calling environment will retain the same value as before unset(3) was called.
<?php
function foo(&$bar)
{
unset($bar);
$bar = "blah";
}
$bar = 'something';
echo "$bar
";
foo($bar);
echo "$bar
";
?>
The above example will output:
something
something
If a static variable is unset(3) inside of a function, unset(3) destroys the variable only in the context of the rest of a function. Fol-
lowing calls will restore the previous value of a variable.
<?php
function foo()
{
static $bar;
$bar++;
echo "Before unset: $bar, ";
unset($bar);
$bar = 23;
echo "after unset: $bar
";
}
foo();
foo();
foo();
?>
The above example will output:
Before unset: 1, after unset: 23
Before unset: 2, after unset: 23
Before unset: 3, after unset: 23
PARAMETERS
o $var
- The variable to be unset.
o $...
- Another variable ...
RETURN VALUES
No value is returned.
EXAMPLES
Example #1
unset(3) example
<?php
// destroy a single variable
unset($foo);
// destroy a single element of an array
unset($bar['quux']);
// destroy more than one variable
unset($foo1, $foo2, $foo3);
?>
Example #2
Using (unset) casting
(unset) casting is often confused with the unset(3) function. (unset) casting serves only as a NULL-type cast, for completeness. It
does not alter the variable it's casting.
<?php
$name = 'Felipe';
var_dump((unset) $name);
var_dump($name);
?>
The above example will output:
NULL
string(6) "Felipe"
NOTES
Note
Because this is a language construct and not a function, it cannot be called using variable functions.
Note
It is possible to unset even object properties visible in current context.
Note
It is not possible to unset $this inside an object method since PHP 5.
Note
When using unset(3) on inaccessible object properties, the __unset() overloading method will be called, if declared.
SEE ALSO isset(3), empty(3), __unset(), array_splice(3).
PHP Documentation Group UNSET(3)