Sponsored Content
Full Discussion: Perl help for file handling
Top Forums Programming Perl help for file handling Post 302532390 by yazu on Monday 20th of June 2011 11:58:48 PM
Old 06-21-2011
DELETED

Last edited by yazu; 06-21-2011 at 08:36 AM.. Reason: OP changed question
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

file handling problem in perl......

Hi, I am opening a file......then i am wrting some data into it......and i am reopening the file again but ......i get a error cannot open file....... $::file= "\adder\testfile.txt" open(TEST1,$::file); some write operation close(TEST1) open(TEST1,$::file) 'I GET A ERROR CAN OPEN... (2 Replies)
Discussion started by: vivekshankar
2 Replies

2. Shell Programming and Scripting

Signal handling in Perl

Guys, I'm doing signal handling in Perl. I'm trying to catch ^C signal inside the script. There two scripts : one shell script and one perl script. The shell script calls the perl script. For e.g. shell script a.sh and perl scipt sig.pl. Shell script a.sh looks something like this :... (6 Replies)
Discussion started by: obelix
6 Replies

3. Shell Programming and Scripting

Perl revers File handling

Hi Experts, I have a big text file, so I want read it at eof to upper bound !. after I use a fseek to go SEEK_END, is it possible to step up upperbound? Best Regards. Note that I'm used perl script. (2 Replies)
Discussion started by: Zaxon
2 Replies

4. Programming

XML Handling in Perl

Hi there, I'm newby in perl and XML. I can read and parse Xml with XML-Node upper XML::Parser, but how can I create XML tags and pack my individual data in it then send through socket. PLZ lead me :) Thanks in Advance. (1 Reply)
Discussion started by: Zaxon
1 Replies

5. Shell Programming and Scripting

file handling in perl without using system command

Hi , Is there any way to achieve following using perl program (i.e without using system command). 1.system ("echo 'test' > /usr/spool/ship.csv"); 2.system ("cat /usr/ajay_test* >> /usr/spool/RAM/work/patil.csv"); 3.system("> /usr/spool/ajay.txt"); e.g for system("rm -f... (1 Reply)
Discussion started by: ajaypatil_am
1 Replies

6. Shell Programming and Scripting

Perl and Sockets - Error handling

Hello all, I have created a Perl script that tries to open connections to various systems on different ports in order to see if the machines are reachable, the ports are open, etc. There appears to be a difference between Solaris (10) and Linux (RH/Oracle and Ubuntu) in the status or error it... (4 Replies)
Discussion started by: Hollinch
4 Replies

7. Shell Programming and Scripting

Handling Parameters in Perl

Hi All, I'm pretty new to the forum and also to UNIX. I have a requirement for which I need some help. I have a script (example.script) where I get user inputs using the read command. I would need to pass the read-fetched input to a perl command (explained below) in my script. The part which... (3 Replies)
Discussion started by: bharath.gct
3 Replies

8. Shell Programming and Scripting

PERL error handling

I have a PERL command line embedded in a UNIX script. The script doesn't handle errors coming out of this command. I'm processing large files and occassionally I run out of disk space and end up with half a file. perl -p -e 's/\n/\r\n/g' < TR_TMP_$4 > $4 How do I handle errors coming out... (1 Reply)
Discussion started by: OTChancy
1 Replies

9. Shell Programming and Scripting

Perl file handling error

Hi, I am reading and file and writting each word to other file. where I have used array to store the data. I am getting below error as "Use of uninitialized value in concatenation (.) or string at customize_split_raw.pl line 51, <IN_FILE> " Where my line 51 code is 50 foreach... (8 Replies)
Discussion started by: Beginer123
8 Replies

10. Shell Programming and Scripting

Perl : How is file handling working here??

Hi, I have a perl script which is just reading from the file but what I would like to understand is how the counter is moving without using the loop in the script. Below are the details: $ more /tmp/abc.txt This is 0 This is 1 This is 2 This is 3 This is 4 This is 5 This is 6 This... (2 Replies)
Discussion started by: siddharthjindal
2 Replies
IMAP::Shell(3pm)					User Contributed Perl Documentation					  IMAP::Shell(3pm)

NAME
Cyrus::IMAP::Shell - Perl version of cyradm SYNOPSIS
$ cyradm [--user authid] [--authz authzid] [--[no]rc] [--systemrc file] [--userrc file] > [--port n] [--auth mechanism] [--server] server but possibly $ perl -MCyrus::IMAP::Shell -e 'run("myscript")' or even (not recommended) use Cyrus::IMAP::Admin::Shell; run('myscriptname'); DESCRIPTION
This module implements cyradm in Perl. It is a shell around Cyrus::IMAP::Admin. Commands are provided in both Tcl-compatible forms and GNU-style long option forms. COMMANDS
"authenticate" ["--minssf" N] ["--maxssf" N] ["--mechanisms" list] [user] "auth" ["--minssf" N] ["--maxssf" N] ["--mechanisms" list] [user] "login" ["--minssf" N] ["--maxssf" N] ["--mechanisms" list] [user] Authenticate to server. You must already be connected to a server and Cyrus imapd will refuse to allow you to re-authenticate once you have authenticated once. "chdir" directory "cd" directory Change directory. A "pwd" builtin is not provided, but the default command action will run "pwd" from a shell if invoked. "createmailbox" ["--partition" partition] mailbox "createmailbox" mailbox partition "create" ["--partition" partition] mailbox "create" mailbox partition "cm" ["--partition" partition] mailbox "cm" mailbox partition Create a mailbox on the default or a specified partition. Both old-style and getopt-style usages are accepted (combining them will produce an error). "deleteaclmailbox" mailbox id [...] "deleteacl" mailbox id [...] "dam" mailbox id [...] Remove ACLs from the specified mailbox. "deletemailbox" mailbox "delete" mailbox "dm" mailbox Delete the specified mailbox. Administrators do not have implicit delete rights on mailboxes. Use the setaclmailbox command to grant the "k" permission to your principal if you need to delete a mailbox you do not own. Note that the online help admits to an optional host argument. This argument is not currently used, and will be rejected with an error if specified; it is reserved for IMSP. "disconnect" "disc" Disconnect from the current server. The prompt will revert to "cyradm>". "exit" [number] "quit" [number] Exit cyradm, optionally with a specific exit status; the exit status of the last command will be used if one is not specified. help [command] ? [command] Show help for "command" or all commands. "info" [mailbox] Display the mailbox/server metadata. listaclmailbox mailbox listacl mailbox lam mailbox List ACLs on the specified mailbox. "listmailbox" ["--subscribed"] [pattern [reference]] "list" ["--subscribed"] [pattern [reference]] "lm" ["--subscribed"] [pattern [reference]] List all, or all subscribed, mailboxes matching the specified pattern. The pattern may have embedded wildcards '*' or '%', which match anything or anything except the separator character, respectively. Mailboxes returned will be relative to the specified reference if one is specified. This allows a mailbox list to be limited to a particular hierarchy. In some cases when the '%' wildcard is used to end a pattern, it may match an entry which is not a mailbox but which contains other mailboxes. In this case, the entry will be parenthesized to indicate that it is a root for other mailboxes, as opposed to a mailbox itself. "listquota" root "lq" root List quotas on specified root. If the specified mailbox path does not have a quota assigned, an error will be raised; see listquotaroot for a way to find the quota root for a mailbox. "listquotaroot" mailbox "lqm" mailbox "lqr" mailbox? show quota roots and quotas for mailbox "mboxconfig" mailbox attribute value "mboxcfg" mailbox attribute value Set mailbox metadata. A value of "none" will remove the attribute. The currently supported attributes are: "comment" Sets a comment or description associated with the mailbox. "expire" Sets the number of days after which messages will be expired from the mailbox. "news2mail" Sets an email address to which messages injected into the server via NNTP will be sent. "sharedseen" Enables the use of a shared Seen flag on messages rather than a per-user Seen flag. The 's' right in the mailbox ACL still controls whether a user can set the shared Seen flag. "sieve" Indicates the name of the global sieve script that should be run when a message is delivered to the shared mailbox (not used for personal mailboxes). "squat" Indicates that the mailbox should have a squat index created for it. "renamemailbox" ["--partition" partition] oldname newname "rename" ["--partition" partition] oldname newname "renm" ["--partition" partition] oldname newname "renamemailbox" oldname newname [partition] "rename" oldname newname [partition] "renm" oldname newname [partition] Rename the specified mailbox, optionally moving it to a different partition. Both old-style and getopt-style usages are accepted; combining them will produce an error. server [--noauthenticate] [server] connect [--noauthenticate] [server] servername [--noauthenticate] [server] With no arguments, show the current server. With an argument, connect to that server. It will prompt for automatic login unless the "--noauthenticate" option is specified. (This may change; in particular, either automatic authentication will be removed or all "authenticate" options will be added.) When connected to a server, cyradm's prompt changes from "cyradm>" to "servername>", where servername is the fully qualified domain name of the connected server. "setaclmailbox" mailbox id rights [id rights ...] "setacl" mailbox id rights [id rights ...] "sam" mailbox id rights [id rights ...] Set ACLs on a mailbox. The ACL may be one of the special strings "none", "read" ("lrs"), "post" ("lrsp"), "append" ("lrsip"), "write" ("lrswipkxte"), "delete" ("lrxte"), or "all" ("lrswipkxte"), or any combinations of the ACL codes: l Lookup (mailbox is visible to LIST/LSUB, SUBSCRIBE mailbox) r Read (SELECT/EXAMINE the mailbox, perform STATUS) s Seen (set/clear SEEN flag via STORE, also set SEEN flag during APPEND/COPY/FETCH BODY[...]) w Write flags other than SEEN and DELETED i Insert (APPEND, COPY destination) p Post (send mail to mailbox) k Create mailbox (CREATE new sub-mailboxes, parent for new mailbox in RENAME) x Delete mailbox (DELETE mailbox, old mailbox name in RENAME) t Delete messages (set/clear DELETED flag via STORE, also set DELETED flag during APPEND/COPY) e Perform EXPUNGE and expunge as part of CLOSE a Administer (SETACL/DELETEACL/GETACL/LISTRIGHTS) "setinfo" attribute value Set server metadata. A value of "none" will remove the attribute. The currently supported attributes are: "motd" Sets a "message of the day". The message gets displayed as an ALERT upon connection. "comment" Sets a comment or description associated with the server. "admin" Sets the administrator email address for the server. "shutdown" Sets a shutdown message. The message gets displayed as an ALERT and all users are disconnected from the server (subsequent logins are disallowed). "expire" Sets the number of days after which messages will be expired from the server (unless overridden by a mailbox annotation). "squat" Indicates that all mailboxes should have a squat indexes created for them (unless overridden by a mailbox annotation). "setquota" root resource value [resource value ...] "sq" root resource value [resource value ...] Set a quota on the specified root, which may or may not be an actual mailbox. The only resource understood by Cyrus is "STORAGE". The units are as defined in RFC 2087, groups of 1024 octets (i.e. Kilobytes). The value may be the special string "none" which will remove the quota. "version" "ver" Display the version info of the current server. "xfermailbox" ["--partition" partition] mailbox server "xfer" ["--partition" partition] mailbox server "xfermailbox" mailbox server [partition] "xfer" mailbox server [partition] Transfer (relocate) the specified mailbox to a different server. Both old-style and getopt-style usages are accepted; combining them will produce an error. NOTES
GNU-style long options must be given in their entirety; Tcl-style options may be abbreviated. Tcl-style options are provided as a compatibility feature. They will probably go away in the future. Multiple commands can be given on a line, separated by ';' characters. All commands set an exit status, which at present is not useful. Unknown commands are passed to a subshell for execution. The Tcl version of cyradm is used for scripting as well as interactively. While this is possible to a limited extent by use of the "run" method, scripting would normally be done with "Cyrus::IMAP::Admin", which is far more flexible than either interactive "cyradm" or the Tcl scripting mechanism for Cyrus. cyradm understands /bin/sh-style redirection: any command can have its standard or error output redirected, with all sh-style redirections (except "<>") supported. It does not currently understand pipes or backgrounding. If the "Term::Readline::Perl" or "Term::Readline::GNU" modules are available, cyradm will use it. An alias facility is implemented internally, but no access is currently provided to it. This will change, if only to allow some of the predefined aliases to be removed if they conflict with useful shell commands. AUTHOR
Brandon S. Allbery, allbery@ece.cmu.edu SEE ALSO
Cyrus::IMAP::Admin Term::ReadLine sh(1), perl(1), imapd(8). perl v5.14.2 2014-06-03 IMAP::Shell(3pm)
All times are GMT -4. The time now is 03:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy