Sponsored Content
Top Forums Shell Programming and Scripting Shell scripting looping issue Post 303007465 by Don Cragun on Friday 17th of November 2017 02:18:35 AM
Old 11-17-2017
Quote:
Originally Posted by swathi reddy1
Hi Don,

Thanks for your response

1)we are using unix

3)getsequence.txt will contain format like 'E_MSC_EKMS1_20171013_0100127269.dat'
4)these are the files in my directory

Code:
E_MSC_EKMS1_20160501_1100023455.dat
E_MSC_EKMS1_20160501_1100023455.ctl

E_MSC_EKMS1_20160501_1100023456.dat
E_MSC_EKMS1_20160501_1100023456.ctl

E_MSC_EKMS1_20160501_1100023457.dat
E_MSC_EKMS1_20160501_1100023457.ctl

they need to be renamed like

Code:
E_MSC_EKMS1_20160501_0100000005.dat
E_MSC_EKMS1_20160501_0100000005.ctl

E_MSC_EKMS1_20160501_0100000004.dat
E_MSC_EKMS1_20160501_0100000004.ctl

E_MSC_EKMS1_20160501_0100000003.dat
E_MSC_EKMS1_20160501_0100000003.ctl

5)yes when user types 1
The way to tell us what operating system you're using is to show us the output from the command uname -a.

If I understand your code correctly (and I am not sure that I do), if the first line of the contents of getsequence.txt is:
Code:
E_MSC_EKMS1_20171013_0100127269.dat

where did the IncSequence values 5, 4, and 3 come from??? Shouldn't the files be renamed as follows?:
Code:
Old name:				New name:
===================================	===================================
E_MSC_EKMS1_20160501_1100023455.ctl	E_MSC_EKMS1_20160501_0100127270.ctl
E_MSC_EKMS1_20160501_1100023455.dat	E_MSC_EKMS1_20160501_0100127270.dat
E_MSC_EKMS1_20160501_1100023456.ctl	E_MSC_EKMS1_20160501_0100127271.ctl
E_MSC_EKMS1_20160501_1100023456.dat	E_MSC_EKMS1_20160501_0100127271.dat
E_MSC_EKMS1_20160501_1100023457.ctl	E_MSC_EKMS1_20160501_0100127272.ctl
E_MSC_EKMS1_20160501_1100023457.dat	E_MSC_EKMS1_20160501_0100127272.dat

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Issue with Shell Scripting..

Hi Guys.. I need a solution for these two questions... Plz help me... 1)How can you load multiple files in a script ? 2)How do you get a process Id for multiple files in a shell script ? (3 Replies)
Discussion started by: mraghunandanan
3 Replies

2. Shell Programming and Scripting

[Solved] help me in this looping in shell scripting

Hi, #!/bin/ksh result='/TIA/app/UniQP/queue/document/CSB' i=0; while ; do i=`expr $i + 1` if ($i -lt 5);then echo "THerrFile_$i.err"; else break; fi done ... (0 Replies)
Discussion started by: sudhir_83k
0 Replies

3. Shell Programming and Scripting

Help with looping in shell scripting

Hi there im totally new to shell scripting and i find it very interesting. I come from java programming background. Basically what i need is to loop a string of say all possible permutations of 20 displayable characters and md5 hash the string till it produces a 128 bit hash value with say 4... (17 Replies)
Discussion started by: jremio
17 Replies

4. Shell Programming and Scripting

Sftp in shell Scripting issue

I have the below code for ftping a file sftp "ogl@serverna,me"ogl@serverna,me <<EOF cd $path_on_the_server binary put $path_on_my_sever/filename.txt bye EOF Not sure is this works.but when i tried its asking for password .How i can avoid asking password and provide it in the... (5 Replies)
Discussion started by: shyamrad
5 Replies

5. Shell Programming and Scripting

Sql issue in shell scripting

HI friends , i am also facing an issue in mysql i ma trying to insert detail in a variable but not got success #!/bin/sh mysql -u<username> -p<password> <dbname> << EOF DEV=`mysql --skip-column-names <dbname> -e "SELECT timestamp from process_record where id = 1"` EOF echo $DEV ERROR... (3 Replies)
Discussion started by: sanjay833i
3 Replies

6. Shell Programming and Scripting

Shell Scripting Issue

Hi I have a requirement where in I need to check 103,104,105 letters in each line and if it equal to MAS then I need to copy the whole line (Till End) to a file. In case if there are 10 lines, all these lines must be copied to a file. Can you please help me with script. (1 Reply)
Discussion started by: krishna87
1 Replies

7. UNIX for Dummies Questions & Answers

Shell Scripting Issue

Hi I have a requirement where in I need to check 103,104,105 letters in each line and if it equal to MAS then I need to copy the whole line (Till End) to a file. In case if there are 10 lines, all these lines must be copied to a file. Can you please help me with script. (1 Reply)
Discussion started by: krishna87
1 Replies

8. Shell Programming and Scripting

Shell scripting issue-running the background script

I have written the below query to genrate a telephone.I am passing account number from oracle database. I am calling 2 scripts which generate the bill 1. bip.sh (it runs in the background) 2.runXitInvoice_PROFORMA_integ bip.sh generates a number which runXitInvoice_PROFORMA_integ uses.How... (7 Replies)
Discussion started by: rafa_fed2
7 Replies

9. Shell Programming and Scripting

Issue with looping

Hi guys, I am creating a script that checks if a service is UP and running on a bunch of remote servers. My list of servers is: p2 runtime1 8080 p3 runtime2 8080 p4 runtime3 8080 p5 runtime4 8080 p6 runtime5 8080 p7 runtime6 8080 p8 runtime7 8080 p9 runtime8 8080 p10 runtime9 8080... (4 Replies)
Discussion started by: Junaid Subhani
4 Replies

10. Shell Programming and Scripting

Shell Scripting - CHMOD issue

Hi Friends , good morning . I am very new to Unix scripting and require a bit of advice to help resolve the below issue . Hope some one can provide some suggestion I have the below script which calls a Oracle stored procedure which inturn extracts data from a table and writes in a ascii... (4 Replies)
Discussion started by: J1nx007
4 Replies
rpld-*(1)					       System User's Manual: rpld-deprecated						 rpld-*(1)

NAME
rpld-deprecated - Deprecated RoarAudio PlayList Daemon control programs SYNOPSIS
rpld-play rpld-stop rpld-next [--ifcurple PLE] rpld-prev rpld-addplaylist PLI rpld-delplaylist PLI rpld-store DESCRIPTION
The RoarAudio PlayList Daemon is a daemon which manages playlists and can play files or streams from those lists using a RoarAudio Sound Server. This is a set of deprecated tools to do simple control of the server. All those tools has be replaced by rpld-ctl(1). The following tools are deprecated: rpld-play Start playback if not yet started. Replaced by: rpld-ctl play rpld-stop Stop playback. Replaced by: rpld-ctl stop rpld-next [--ifcurple PLE] Skip current song. if --ifcurple and a PLE is given the song is only skiped if the currently played song matches the given PLE. This tool has only been deprecated in case --ifcurple is not used. Replaced by: rpld-ctl next rpld-prev Go back to previous song. Replaced by: rpld-ctl prev rpld-addplaylist PLI Add playlist with name PLI. Replaced by: rpld-ctl addplaylist PLI rpld-delplaylist PLI Delete playlist PLI. Replaced by: rpld-ctl delplaylist PLI rpld-store Store current state to disk. This tool should not be needed to be called by a user at all for normal use cases. Replaced by: rpld-ctl store SEE ALSO
rpld-tools(1), rpld(7), RoarAudio(7). HISTORY
For history information see RoarAudio(7). rpld-deprecated May 2012 rpld-*(1)
All times are GMT -4. The time now is 05:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy