Sponsored Content
Top Forums Shell Programming and Scripting write shell script to rename file Post 302479143 by shubhig15 on Friday 10th of December 2010 01:16:55 AM
Old 12-10-2010
Quote:
Originally Posted by michaelrozar17
As stated earlier, every time it loops through the while condition the move command checks for the sub-directory FILES/type_2.0_20101208_* and copies the file to tmp.xml, since you have given the path as FILES/type_2.0_20101208_${count}.xml/tmp.xml. So unless you have the sub-directory type_2.0_20101208_* created under directory FILES you will have this error.
Guess you are aware of the directory-tree structure, where except tmp.xml all the others are directories and sub-directories here..FILES/type_2.0_20101208_${count}.xml/tmp.xml


how to overcome this type of error.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Shell script to rename or change file extension case.

I searched the forum, but there was different type of rename. Hello. I have files in folder. Like: xxxxxxxx1.html or xxxxxxxx2.txt or xxxxxxxx3.tar.gz and how to rename or change file extension case to xxxxxxxx1.htm or xxxxxxx2.TXT or (5 Replies)
Discussion started by: Sheldon
5 Replies

2. Shell Programming and Scripting

How to write a shell script to notify when certain texts appear in a file?

I have a server and occasionally the file mysqld.log would show something like /usr/libexec/mysqld: Disk is full writing './example_com_-_wordpress/wp_statpress.MYD' (Errcode: 122). Waiting for someone to free space... Retry in 60 secs How do I write a simple shell script to check mysqld.log... (1 Reply)
Discussion started by: acider
1 Replies

3. UNIX for Advanced & Expert Users

Rename a file to a file_current datetime in a shell script

Hi all, Could anyone suggest me on Renaming a file to a file_current datetime in a shell script. (3 Replies)
Discussion started by: Nithin
3 Replies

4. Shell Programming and Scripting

write shell script to search file in folder

hi .. i have a problem how to search file with date and version number(ms_2.0_dd/mm/yy_24)in folder.Here 24 is version number and compare the this file to other file which is in another folder and if does not match then copy this file to respective folder.Also copy different files in different... (1 Reply)
Discussion started by: shubhig15
1 Replies

5. Shell Programming and Scripting

Write output to a file using Korn shell script

All, Can anyone please help me with the below scenario in korn shell script. Can anyone please give me some hints to proceed on this. I have a Flat file of the below format. Input file format:... (1 Reply)
Discussion started by: sp999
1 Replies

6. Shell Programming and Scripting

how to write multiple lines to a file using shell script?

I need to create an xml using shell script, but i first want to know how can i write multiple lines to file using shell script? (7 Replies)
Discussion started by: vel4ever
7 Replies

7. Shell Programming and Scripting

How can I write the specific content in the file through shell script

Hello, I need to do one thing that my script creates the file touch release.SPLASH_12_03_00_RC01.txt Now I want to update that file with some content e.g splashbuild::SPLASH_12_17_00_RC02.zip Thanks (1 Reply)
Discussion started by: anuragpgtgerman
1 Replies

8. Shell Programming and Scripting

How to write rename script?

I have files fd01.calc,fd02.calc,fd03.calc..I want to rename in fd01.picks,fd02.picks,fd03.picks How to do this? (4 Replies)
Discussion started by: mikibelavista
4 Replies

9. Shell Programming and Scripting

Need help to write a shell script to convert text file to excel file.

Hi Everyone, I want your help to write a script which will take text file as input and on the basis of delimiter ":"script will create excel sheet. Example input: IpAdress:InstanceName:Port:ServerName 10.255.255.1:abc:2232:xyz_abc Output should be an excel sheet like below: Column... (8 Replies)
Discussion started by: akabhinav18
8 Replies

10. Shell Programming and Scripting

Help required with a file rename shell script

Hello everyone, Posting here after a long time, been away from unix world lately and it seems I have forgotten my shell scripting completely. I have a requirement where a csv file contains following columns: Full Registration VIN Stock... (14 Replies)
Discussion started by: tayyabq8
14 Replies
inetconv(1M)                                              System Administration Commands                                              inetconv(1M)

NAME
inetconv - convert inetd.conf entries into smf service manifests, import them into smf repository SYNOPSIS
inetconv -? inetconv [-f] [-n] [-i srcfile] [-o destdir] inetconv -e [-n] [-i srcfile] DESCRIPTION
The inetconv utility converts a file containing records of inetd.conf(4) into smf(5) service manifests, and then import those manifests into the smf repository. Once the inetd.conf file has been converted, the only way to change aspects of an inet service is to use the inetadm(1M) utility. There is a one-to-one correspondence between a service line in the input file and the manifest generated. By default, the manifests are named using the following template: <svcname>-<proto>.xml The <svcname> token is replaced by the service's name and the <proto> token by the service's protocol. Any slash (/) characters that exist in the source line for the service name or protocol are replaced with underscores (_). The service line is recorded as a property of the converted service. During the conversion process, if a service line is found to be malformed or to be for an internal inetd service, no manifest is generated and that service line is skipped. The input file is left untouched by the conversion process. OPTIONS
The following options are supported: -? Display a usage message. -e Enable smf services which are listed in the input file. -f If a service manifest of the same name as the one to be generated is found in the destination directory, inetconv will overwrite that manifest if this option is specified. Otherwise, an error message is generated and the conversion of that service is not performed. -i srcfile Permits the specification of an alternate input file srcfile. If this option is not specified, then the inetd.conf(4) file is used as input. -n Turns off the auto-import of the manifests generated during the conversion process. Later, if you want to import a generated manifest into the smf(5) repository, you can do so through the use of the svccfg(1M) utility. If the -e option is specified, the -n option only displays the smf services that would be enabled. -o Permits the specification of an alternate destination directory destdir for the generated manifests. If this option is not specified, then the manifests are placed in /var/svc/manifest/network/rpc, if the service is a RPC service, or /var/svc/manifest/network other- wise. EXAMPLES
Example 1: Generating smf Manifests from inetd.conf The following command generates smf(5) manifests from inetd.conf(4) and places them in /var/tmp, overwriting any preexisting manifests of the same name, and then imports them into the smf repository. # inetconv -f -o /var/tmp 100232/10 -> /var/tmp/100232_10-rpc_udp.xml Importing 100232_10-rpc_udp.xml ...Done telnet -> /var/tmp/telnet-tcp6.xml Importing telnet-tcp6.xml ...Done Example 2: Generating Manifests from an Alternate Input File The following command specifies a different input file and does not load the resulting manifests into the smf repository. # inetconv -n -i /export/test/inet.svcs -o /var/tmp 100232/10 -> /var/tmp/100232_10-rpc_udp.xml telnet -> /var/tmp/telnet-tcp6.xml EXIT STATUS
The following exit values are returned: 0 Operation completed successfully (no errors). 1 Invalid options specified. 2 One or more service lines are malformed, and thus no manifest(s) were generated for them. 3 An error occurred importing one or more of the generated manifests. 4 A system error occurred. FILES
/var/svc/manifest/network/{rpc}/<svcname>-<proto>.xml default output manifest file name ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
inetadm(1M), inetd(1M), svccfg(1M), inetd.conf(4), attributes(5), smf(5) SunOS 5.10 21 Oct 2004 inetconv(1M)
All times are GMT -4. The time now is 08:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy