cp -a `ls | grep -v yourexcludepattern` ../destinationdir/
Assume, you want to copy all files, except *.java within from the current directory to the foo directory. Then, the command would be,
cp -a `ls | grep -v *.java` /home/wageesha/foo
cp -a `ls | grep -v yourexcludepattern` ../destinationdir/
cp -a `ls | grep -v *.java` /home/wageesha/foo
for dir in *; do [ -d "$dir" ] && cp file.txt "$dir" ; done
for dir in *; do [ -d "$dir" ] && cp -rf /home/wageesha/images "$dir" ; done
getAPIKey.inputTypes = { "username" : "string", "password" : "string", "url" : "string" };
getAPIKey.output = "string";
function getAPIKey(username, password, url) {
var client = new HttpClient();
var code = client.executeMethod("GET", "https://www.google.com/accounts/Login");
if (code == 200) {
var galx = client.cookies[0].value;
var content = [
{ name : "Email", value : username },
{ name : "Passwd", value : password },
{ name : "signIn", value : "Sign in" },
{ name : "GALX", value : String(galx) },
{ name : "dsh", value : "5537526595243201224"},
{ name : "rmShown", value : "1"},
{ name : "PersistentCookie", value : "yes"}
];
code = client.executeMethod("POST", "https://www.google.com/accounts/LoginAuth", content);
if (code == 302 || code == 200) {
code = client.executeMethod("GET", "http://code.google.com/apis/maps/signup/createkey", [
{ name : "referer", value : url }
]);
if (code == 200) {
var response = eval('(' + client.response + ')');
client.releaseConnection();
return response.generated_key;
} else {
client.releaseConnection();
return new XML("" + code + "" + client.statusText + " ");
}
} else {
client.releaseConnection();
return new XML("" + code + "" + client.statusText + " ");
}
} else {
client.releaseConnection();
return new XML("" + code + "" + client.statusText + " ");
}
}
$ svn merge -rHEAD:90 .As you have used . at the end, it will revert your local repository. Once commited you will get a new revision such as 101 which is same as revision 90. You can do this directly to a remote repository as well. In that case, replace . with repository url.
function serialize(mixed_value) {
var _getType = function(inp) {
var type = typeof inp, match;
var key;
if (type == 'object' && !inp) {
return 'null';
}
if (type == "object") {
if (!inp.constructor) {
return 'object';
}
var cons = inp.constructor.toString();
match = cons.match(/(\w+)\(/);
if (match) {
cons = match[1].toLowerCase();
}
var types = ["boolean", "number", "string", "array"];
for (key in types) {
if (cons == types[key]) {
type = types[key];
break;
}
}
}
return type;
};
var type = _getType(mixed_value);
var val, ktype = '';
switch (type) {
case "function":
val = "";
break;
case "null":
case "undefined":
val = "N";
break;
case "boolean":
val = "b:" + (mixed_value ? "1" : "0");
break;
case "number":
val = (Math.round(mixed_value) == mixed_value ? "i" : "d") + ":" + mixed_value;
break;
case "string":
val = "s:" + mixed_value.length + ":\"" + mixed_value + "\"";
break;
case "array":
case "object":
val = "a";
var count = 0;
var vals = "";
var okey;
var key;
for (key in mixed_value) {
ktype = _getType(mixed_value[key]);
if (ktype == "function") {
continue;
}
okey = (key.match(/^[0-9]+$/) ? parseInt(key, 10) : key);
vals += serialize(okey) +
serialize(mixed_value[key]);
count++;
}
val += ":" + count + ":{" + vals + "}";
break;
}
if (type != "object" && type != "array") {
val += ";";
}
return val;
}
The code fragment below will do the serializing in Javascript and the later code will unserialize it in PHP.var array = ["ruchira", "wageesha"]; //serialize value var serialize_array = serialize(array);
$array = unserialize($_POST['array']);