I can't take credit for the meat and potatoes of this script, but I can't remember who gave it to me and from what forum. But it does replace : in file names and replaces them with a - and then changes the file extention to dat. This might work for you. I hope this helps. I use this to take files from UNIX and make them readable in DOS, and then clean up after itself.
##
Subsitute your file names and spaces.
Last edited by bakunin; 11-03-2009 at 06:26 AM..
Reason: added code-tags
I am trying to strip all leading and trailing spaces of a shell variable using either awk or sed or any other utility, however unscuccessful and need your help.
echo $SH_VAR | command_line Syntax.
The SH_VAR contains embedded spaces which needs to be preserved. I need only for the leading and... (6 Replies)
I need to work with 'nice' directory names which have some spaces in name, and that brings some questions and not-understanding.
Would some expert help me out how to deal with that?!
My task is to document some processing, running from some script. I do need to have spaces in directories... (2 Replies)
Hi,
I have a problem where I need to append few spaces(say 10 spaces) for each line in a file whose length is say(100 chars) and others leave as it is.
I tried to find the length of each line and then if the length is say 100 chars then tried to write those lines into another file and use a sed... (17 Replies)
Hello All,
I am trying to remove all tabspaces and all blankspaces from my file using sed & awk, but not getting proper code. Please help me out.
My file is like this (<b> means one blank space, <t> means one tab space)-
$ cat file
NARESH<b><b><b>KUMAR<t><t>PRADHAN... (3 Replies)
Open to a sed/awk/or perl alternative so that i can stick command into my bash script.
This is a problem I resolve using a combination of cut commands - but that is getting convoluted. So would really appreciate it if someone could provide a better solution which basically replaces all... (3 Replies)
I need to read pdf files copied in a unix directory.I tried using the for loop with find command but the file names is cutting off at the spaces.Below is the code I tried.
for FILENAME in `find $DIR_FILE/ -name "*.pdf" -mindepth 1 -maxdepth 1 -mmin +60 ` ##Needs to be changed later +60 to -60
do... (4 Replies)
Hi,
I am writing a shell script to build Java options dynamically in a variable array and pass them to java.exe. If an option value contains a space, I cannot find a way to get it interpreted correctly. Here is my example:
#!/bin/bash
JAVA_HOME=/opt/jvm/jre1.5.0_18
JAVA_OPTS=("-Xms256m... (4 Replies)
Hi all,
I've a requirement as below
Source file src.txt sample data:
A<10 white spaces>B12<5 white spaces>C<17 white spaces>
A1<5 white spaces>B22<5 white spaces>C13<17 white spaces>
when I'm fetching a record from this file into a shell variable like below:
vRec=`head -1 src.txt... (2 Replies)
Hello everyone, I'm in need of some assistance. I'm currently enrolled in an introductory UNIX shell programming course and, well halfway through the semester, we are receiving our first actual assignment. I've somewhat realized now that I've fallen behind, and I'm working to get caught up, but for... (1 Reply)
Discussion started by: MrMagoo22
1 Replies
LEARN ABOUT PHP
imap_createmailbox
IMAP_CREATEMAILBOX(3) 1 IMAP_CREATEMAILBOX(3)imap_createmailbox - Create a new mailboxSYNOPSIS
bool imap_createmailbox (resource $imap_stream, string $mailbox)
DESCRIPTION
Creates a new mailbox specified by $mailbox.
PARAMETERS
o $
imap_stream -An IMAP stream returned by imap_open(3).
o $mailbox
- The mailbox name, see imap_open(3) for more information. Names containing international characters should be encoded by
imap_utf7_encode(3)RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
imap_createmailbox(3) example
<?php
$mbox = imap_open("{imap.example.org}", "username", "password", OP_HALFOPEN)
or die("can't connect: " . imap_last_error());
$name1 = "phpnewbox";
$name2 = imap_utf7_encode("phpnewbox"); // phpnewb&w7Y-x
$newname = $name1;
echo "Newname will be '$name1'<br />
";
// we will now create a new mailbox "phptestbox" in your inbox folder,
// check its status after creation and finally remove it to restore
// your inbox to its initial state
if (@imap_createmailbox($mbox, imap_utf7_encode("{imap.example.org}INBOX.$newname"))) {
$status = @imap_status($mbox, "{imap.example.org}INBOX.$newname", SA_ALL);
if ($status) {
echo "your new mailbox '$name1' has the following status:<br />
";
echo "Messages: " . $status->messages . "<br />
";
echo "Recent: " . $status->recent . "<br />
";
echo "Unseen: " . $status->unseen . "<br />
";
echo "UIDnext: " . $status->uidnext . "<br />
";
echo "UIDvalidity:" . $status->uidvalidity . "<br />
";
if (imap_renamemailbox($mbox, "{imap.example.org}INBOX.$newname", "{imap.example.org}INBOX.$name2")) {
echo "renamed new mailbox from '$name1' to '$name2'<br />
";
$newname = $name2;
} else {
echo "imap_renamemailbox on new mailbox failed: " . imap_last_error() . "<br />
";
}
} else {
echo "imap_status on new mailbox failed: " . imap_last_error() . "<br />
";
}
if (@imap_deletemailbox($mbox, "{imap.example.org}INBOX.$newname")) {
echo "new mailbox removed to restore initial state<br />
";
} else {
echo "imap_deletemailbox on new mailbox failed: " . implode("<br />
", imap_errors()) . "<br />
";
}
} else {
echo "could not create new mailbox: " . implode("<br />
", imap_errors()) . "<br />
";
}
imap_close($mbox);
?>
SEE ALSO imap_renamemailbox(3), imap_deletemailbox(3).
PHP Documentation Group IMAP_CREATEMAILBOX(3)