Require help in creating a Sudo/Shell script


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Require help in creating a Sudo/Shell script
# 1  
Old 10-24-2016
Linux Require help in creating a Sudo/Shell script

Hello Friends,

I have a scenario to create a script, I know many of you feel this as simple script.

I am not much familiar with unix scripting, please help me out.

Situation:-

1. I have a list of config files like 40+ would be getting deployed in the /app/abcd/src/Config/ (This will have hundred's of config files with similar extensions)
2. Now I should write a script where that should search all these new files (40+) in that /app/abcd/src/Config/ directory and if any of the files are not available and those should be displayed as output.

Please assist me in getting this done.

Thanks in advance !

Last edited by Don Cragun; 10-24-2016 at 11:54 PM.. Reason: Add ICODE tags.
# 2  
Old 10-25-2016
Quote:
Originally Posted by ganjvin
Hello Friends,

I have a scenario to create a script, I know many of you feel this as simple script.

I am not much familiar with unix scripting, please help me out.

Situation:-

1. I have a list of config files like 40+ would be getting deployed in the /app/abcd/src/Config/ (This will have hundred's of config files with similar extensions)
2. Now I should write a script where that should search all these new files (40+) in that /app/abcd/src/Config/ directory and if any of the files are not available and those should be displayed as output.

Please assist me in getting this done.

Thanks in advance !
Moderator's Comments:
Mod Comment This thread has been moved to the "UNIX for Beginners Questions & Answers" forum.

You say you have a list of 40+ config files in a directory and you say there will be hundreds of config files in that directory. Then you say that there are 40+ new files and that if any of those new files are not "available", they should be displayed.

Is this list of 40+ files contained in your head? Is it written on a Post-It note? Is it in a file??? Is this list of 40+ files a list of 40+ new and old files? Or is this list of 40+ files just new files?

What determines whether a file is "new" or not? Is there a list of new files?

What is your definition of "available"? The file is present? The file is readable? The file is a readable, regular file? Something else???

What operating system are you using?

What shell are you using?
# 3  
Old 10-25-2016
Actually 40+ new configure files are going to be deployed from UAT to prod. When I say "available " means , currently those new 40+ files are not deployed/available in production environment .
After the deployment, I want a autoscript which can run and say whether these new 40+ new files has been deployed (available) or not.
As of now I have their names handy (40+ file names) , we can create a .txt file and save them.
so, all file names are unique with their naming convention so that would.

Those files could be .jil (autosys objects) or . Prm (config objects)

It's a Sudo-SH .
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell sIs there something special I need to do when using sudo in a script?

I have a script in which I used "sudo -s" I notice some extremely strange behavior when executing this script. To investigate this I decided to recreate the problem in the following script. I notice that "sudo -s" is only being executed one time. Soon after completely falls apart. Is there... (4 Replies)
Discussion started by: busi386
4 Replies

2. Shell Programming and Scripting

Creating IN list in PLSQL script dynamically by using shell script

Hi all, I have a PLSQL script which has a IN list where it takes some ids as input. For example SELECT * FROM EMPLOYEE WHERE EMPLOYEE_ID IN (comma separated list ) I want to run this quest inside a shell script but I would like to prepare the IN list dynamically where the employee ids... (1 Reply)
Discussion started by: LoneRanger
1 Replies

3. Shell Programming and Scripting

Help in creating Sudo ssh script

Hi Experts, I am new to Shell scripting. I want to login to a server using a script. The normal command I use is --> sudo ssh <Servername> . when i tried putting this into a txt format file and tried running, it throw an error "can't execute". I am an Admin and i have root access. Any help would... (6 Replies)
Discussion started by: Tom1989
6 Replies

4. Shell Programming and Scripting

Help with Shell Script on sudo

I want to execute a script(generateReport.sh) which resides on root home directory from shell script(localtrigger.sh) as root by using sudo. The thing is i cant edit /etc/sudoers (i can but m not allowed to do it , ethically) i cant change ownership of generateReport.sh script When i try... (7 Replies)
Discussion started by: saket
7 Replies

5. Shell Programming and Scripting

sudo su - user in a shell script

Normally i would google, but I did not know how to google the problem I am facing now also being a newbie in shell scripting. Okay, the requirement is user1 has sudo rule to su - user2(NO PASSWORD) and user2 has will be able to sudo certain commands so following works fine from command prompt... (2 Replies)
Discussion started by: beEnthu
2 Replies

6. Shell Programming and Scripting

shell script problem , sudo mount command

cat test.sh sudo mount -t vfat /dev/sda7 /media/Ddrive If i double click the test.sh file and select run in terminal then the terminal prompts for password. How can i avoid typing password? Or if i double click test.sh file and select run then nothing happens. What i'm trying "Double... (3 Replies)
Discussion started by: cola
3 Replies

7. Shell Programming and Scripting

(Urgent):Creating flat file using sql script and sqlplus from UNIX Shell Script

Hi, I need help urgently for following issue. Pls help me to resolve this issue. I am calling sql script file(file1.sql) from UNIX Shell Script(script1.ksh) using sql plus and trying to create flat file that contains all records returned from SQL query in SQL script(file1.sql) I given... (6 Replies)
Discussion started by: praka
6 Replies

8. Shell Programming and Scripting

Require Help for Shell Script

Hi friends, i am trying to print warning for partition size which exceed limit of 90% & other are ok. i m using below command which print partition which exceed 90% # df -h | sort -k5 | head -1 | awk 'END{ print $1" :- Not Having more space on This Partition"}' i want to print... (14 Replies)
Discussion started by: jagnikam
14 Replies

9. UNIX for Dummies Questions & Answers

sudo in OS X shell script without password prompt??

I've written a shell script to alter a particular preference file on OS X (10.3.9), which works fine (tested by running the script from the terminal sat in front of the box). Problem is, I now have to run this script remotely across a number of machines via remote desktop, so where I've used the... (1 Reply)
Discussion started by: Brad_GNET
1 Replies

10. Shell Programming and Scripting

help on creating shell script

Can some one smart here help I need to create a shell script that does this below using vi editor. decrypts a file (specified as an argument to the script) containing text which was encrypted using the ROT-13 algorithm. The decrypted text should be written to a new file leaving the input file... (1 Reply)
Discussion started by: master_6ez
1 Replies
Login or Register to Ask a Question