Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Moving file using shell script fails occasionally Post 303046021 by sea on Tuesday 21st of April 2020 07:24:25 PM
Old 04-21-2020
Hi

You define: SOURCEONEACTUAL="a" and SOURCEONENEW="b", but not $SOURCEONEACTUAL116 that you try to ls.
You do delete a script116* file, yet you attempt to write a script.* file.

I belive that script.source.file still has content from you 'earlier tries'.
Because as of now, it (ls) should fail due to missing pattern (filename/s).

Try to use set -x to start, and set +x to end debuging.

Hope this helps
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

need shell script for moving file one by one

#SD=source dir TD= target dir SD="$/amddev/app01/manoj/new/scripts/old" TD="$/amddev/app01/manoj/new/scripts/new" EXT="$*.txt" for i in `ls -F "$SD"/*"$EXT"|grep -v /$` do mv "$SD" "$TD" if then echo "$i" successfully moved echo Manoj successfully..1 ( here i... (8 Replies)
Discussion started by: manojkarthi
8 Replies

2. Shell Programming and Scripting

why shell script fails

hi .. I have automate some process on unix through sehll script . but i don't know there is some problem in scripts, some time shell script works and some time it fails. so my query is that "Why shell script fails some times?" thanks (4 Replies)
Discussion started by: tahir23
4 Replies

3. Shell Programming and Scripting

why shell script fails?

hi , i m trying to run a shell script automatically , some time it works fine but some time it fails , what could be the problem . If anybody have an idea about this problem then reply . Thanks in advacne (4 Replies)
Discussion started by: tahir23
4 Replies

4. Shell Programming and Scripting

shell script for moving all the file from the same folder

Hi , I need a shell script which basicaly moves all the files from one folder say folder x to folder y and once they are moved to folder y a datetimestamp should be attached to there name for ex file a should be moved to y folder and renamed as a_20081015 (1 Reply)
Discussion started by: viv1
1 Replies

5. Shell Programming and Scripting

Shell Script for moving 3 days old file to Archive Folder

Hi Experts, I have a "Source" folder which may contain some files. I need a shell script which should move all files which are older than 3 days to "Archive" folder. Thanks in Advance... (4 Replies)
Discussion started by: phani333
4 Replies

6. Shell Programming and Scripting

Execute shell script even if the first script fails

All, I executing a perl script and shell script from a master shell script. i will execute the perl script first and have to execute the shell script after the completion of perl execution. Below is the code i use for it, script_root='/dev/scripts' /usr/bin/perl -S $script_root/test.pl;... (5 Replies)
Discussion started by: vel4ever
5 Replies

7. Shell Programming and Scripting

How to exit from shell script if above condition fails?

HI cd ${back_home} if above back_home does not exist, then script shoul exit. Please let us know how to do that (7 Replies)
Discussion started by: buzzme
7 Replies

8. Shell Programming and Scripting

Shell Script for renaming and moving Files - Easy?

Hey guys, ive been working on this for about 2hrs now - without any solution. At first I need to say I dont have skills in linux bash scripting, but I tried to use some codesnippets and manuals from google. What I want to do: I have different folders including 2 different filestypes with... (15 Replies)
Discussion started by: peter1337
15 Replies

9. UNIX for Beginners Questions & Answers

Linux shell | how to exit a script if any command fails.

Hi, i am new here let me say HI for all. now i have a question please: i am sending one command to my machine to create 3 names. if one of the names exists then the box return error message that already have the name but will continue to create the rests. How i can break the command and... (7 Replies)
Discussion started by: Amiri
7 Replies

10. Shell Programming and Scripting

Array declared in shell script works for AIX but fails in Linux

Array declared in shell script works for AiX 6.1 and above but fails in Linux CentOS 7. I have the below code for Array in my shell script that runs fine on AiX systems. Note: on AiX it uses ksh shell while on Linux it uses non ksh shell. set -A filelist However, i now wish to use the... (3 Replies)
Discussion started by: mohtashims
3 Replies
SYSCONFTOOL(1)							    sysconftool 						    SYSCONFTOOL(1)

NAME
sysconftool - install configuration files SYNOPSIS
sysconftool [options] [filename.dist...] DESCRIPTION
sysconftool is a development utility that helps to install application configuration files. sysconftool allows an existing application to be upgraded without losing the older version's configuration settings. A new version of an application often introduces new configuration settings. Sometimes obsolete configuration settings are removed. Existing configuration settings may also now have additional options, or certain options are no longer valid any more. Because of this, an application upgrade usually installs a fresh set of configuration files, containing a default configuration that's known to work. Keeping the existing files carries the risk of the application failing to function properly due to a configuration that is no longer valid. A typical application installation script copies over configuration files with default settings. Existing configuration files are backed up or overwritten. With sysconftool, an application will install a configuration file names filename.dist, instead of filename. Then, the application's installation script runs sysconftool. sysconftool copies filename.dist to filename, but also checks if filename from an older version of the application already exist. If filename an older sysconftool-installed configuration file, it's configuration settings replace the defaults in filename.dist, which is then subsequently installed as filename. sysconftool is smart enough to: o Remove configuration settings that no longer exist. o Add new configuration settings. o Do not preserve an older configuration setting if there's a possibility that it is no longer valid in the new version of the application. sysconftool produces a short report when it runs. The report lists every configuration setting in $filename.dist, and its disposition. The possible dispositions are: new This a new configuration setting that wasn't found in the existing $filename. unchanged This setting's value was taken from the existing $filename, replacing the default value provided by $filename.dist. UPDATED This setting has been previously set in $filename, but the setting's value may no longer be valid in the new version of the application, so its default value is taken from $filename.dist, and it may need to be manually adjusted. All this logic is based on some additional metadata that must be included in each configuration file, that sysconftool reads. For this to work, both the old and the new version of the application must be sysconftool-ized. sysconftool operates in a fail-safe mode. If the old version did not use sysconftool, $filename is backed up to $filename.bak, and $filename is copied to $filename. This is what would essentially happen anyway without sysconftool. The local configuration needs to be reentered into $filename, so nothing is lost. However, the next upgrade will see sysconftool do its job. ADDING SYSCONFTOOL SUPPORT TO AN EXISTING APPLICATION
sysconftool requires the application to use autoconf and automake. The first step is to run the sysconftoolize script from the application's source directory. sysconftoolize copies the sysconftool script to the current directory, and appends a default install-configure rule to Makefile.am. After running sysconftoolize the macro AC_PROG_SYSCONFTOOL must be manually added to configure.in, and Makefile.am must be modified as follows. Makefile.am must be modified to install configuration files as filename.dist instead of filename. The default install-configure rule assumes that sysconf_DATA lists all configuration files in sysconfdir, and runs sysconftool on them. This will usually have to be modified, according to the application's individual needs. Finally, Makefile.am must be modified to distribute the sysconftool script in the application's source distribution. Adding sysconftool to EXTRA_DIST is what's needed in most cases. Finally, certain sysconftool magic incantations must be added to the application's configuration files, see sysconftool(7)[1] for more information. The last step involves updating the application's INSTALL instructions, so that the application can be properly installed. The following instructions must be added to INSTALL: 1. Run "make install-configure" after "make install". 2. If this is the first sysconftool-ized version, DO NOT simply copy over the old configuration files, and overwrite the new configuration files. Instead, manually edit each configuration file, and manually reset each configuration setting. This is because the new configuration files include the magic code for sysconftool, which would be lost when the configuration file is overwritten. 3. If this is not the first sysconftool-ized version, the output of make install-configure must be reviewed in order to manually adjust or tweak what sysconftool did. Many large configuration files can result in lots of output, so the output of make install-configure should be saved into a file, and reviewed. SEE ALSO
sysconftoolcheck(1)[2], sysconftool(7)[1]. AUTHORS
Double Precision, Inc. NOTES
1. sysconftool(7) [set $man.base.url.for.relative.links]/sysconftool.7.html 2. sysconftoolcheck(1) [set $man.base.url.for.relative.links]/sysconftoolcheck.1.html Courier Mail Server 04/05/2011 SYSCONFTOOL(1)
All times are GMT -4. The time now is 07:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy