Sponsored Content
Top Forums Shell Programming and Scripting Script to automate recovery process Post 302944504 by Chubler_XL on Tuesday 19th of May 2015 04:58:14 PM
Old 05-19-2015
Code:
for fs in $f{1..12}
do
    mkdir /mnt/$vgname/$fs
    mount /dev/mapper/${vgname}-${fs}
done

However, I would consider using an array instead of f1 .. f12 variables as you are not limited to fixed number of filesystems:

Code:
read -a farray <<<< $(grep $vgname ....)

for fs in ${farray[@]}
do
    mkdir /mnt/$vgname/$fs
    mount /dev/mapper/${vgname}-${fs}
done

And if you don't need access to these values again you avoid any array or variables all together simply like this:

Code:
for fs in $(grep $vgname ... )
do
    mkdir /mnt/$vgname/$fs
    ...
done


Last edited by Chubler_XL; 05-19-2015 at 06:03 PM..
This User Gave Thanks to Chubler_XL For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to automate an FTP process?

Hello script experts, I am newbie to shell script. But I have to write a shell script (ASAP) where I need to ftp a file on daily basis to a remote server, and send an email with final status. I I should have a properties file with hostname, Userid, and pwd. And a shall script file should read... (1 Reply)
Discussion started by: ksak
1 Replies

2. Shell Programming and Scripting

Automate Log Monitoring Process

I am a new member of this forum and am also new to unix shell scripting. I joined the forum to seek for help to achieve my task as this forum helps people. here's what i do manually on daily basis 1)Loginto different unix box 2)Ftp the log files (morethan 50 each dir) to windows 3)use text pad... (3 Replies)
Discussion started by: sharugan
3 Replies

3. Shell Programming and Scripting

Error in script to automate the daily monitoring process of UNIX server and it's proc

hi friends, I am trying to automate the daily monitoring process of UNIX server and it's processes. the script are below i executed the above script using ksh -x monitortest1.sh in root login . It shows error at some lines . 1. i logged in using root ,but it... (8 Replies)
Discussion started by: rdhaprakasam
8 Replies

4. Shell Programming and Scripting

To automate a process

CAN ANYONE HELP TO SOLVE i wann write a script to automate a process .i.e, to search files in the FTP server and and if files are there and we hav to bring that files to our system. After copying the files in our system we have to upload the data in the tables. I have scripts to load the... (0 Replies)
Discussion started by: nani1984
0 Replies

5. UNIX for Advanced & Expert Users

TO Automate the FTP process

Plzz Some One Help in this matter I have scripts to load the data into tables and to copy files from ftp to our system. we use to run the scripts every day.... we hav the files in the FTP server and we hav to bring the files to our system and we hav to load the data into the tables. We... (0 Replies)
Discussion started by: nani1984
0 Replies

6. UNIX for Dummies Questions & Answers

To automate a process

CAN ANYONE HELP TO SOLVE i wann write a script to automate a process .i.e, to search files in the FTP server and and if files are there and we hav to bring that files to our system. After copying the files in our system we have to upload the data in the tables. I have scripts to load the... (2 Replies)
Discussion started by: nani1984
2 Replies

7. Shell Programming and Scripting

Bash script to Automate the Virtual Host creation process!!

Hi all, This is my sample code in /etc/httpd/conf.d/applications.conf file currently we are creating subdomain mannually for every new subdomain. I want to automate this process througs bash script , how its possible. <VirtualHost *:80> ServerName google.com ServerAlias google.com... (5 Replies)
Discussion started by: anishkumarv
5 Replies

8. Shell Programming and Scripting

Need help in creating a shell script to automate svnstats process

Hi, I am trying to create a shell script to automate the following process of getting svn stats:- Step1:- cd to checkout location. Note that the checked code have multiple modules in respective folders Step2:- Execute this command inside each module:- svn log -v --xml >... (0 Replies)
Discussion started by: d8011
0 Replies

9. UNIX for Dummies Questions & Answers

Automate sftp process using script

Hi, guys, I am trying to automate a sftp process using "expect" method (since the key authentication method is disabled in my company network, there is no helping it). In order to try, I type in the command manually: sftp @ > << EOF >cd >ls -l >EOF >Connecting to @servername password: ... (3 Replies)
Discussion started by: warmboy610
3 Replies

10. Open Source

Help with writing Shell Script to automate process using multiple commands

Hello! Need help to write a Linux script that can be run from windows using command/Cygwin/any other way. I am new to scripting, actually i am trying to automate server health check like free disk space, memory along with few services status, if any services is not running then start services ,... (7 Replies)
Discussion started by: Sayed Ibrahim
7 Replies
gitmount(1)						      General Commands Manual						       gitmount(1)

NAME
gitmount - GNU Interactive Tools - auto-mount script SYNTAX
gitmount device DESCRIPTION
gitmount is a script which allows you to mount any block device without specifying the file system type. You may now insert the floppy in the drive and type ' gitmount fd0' and the first floppy will be mounted in the directory /mnt/fd0. On Linux just press F11 or F12. You don't need to know the file system type anymore. The directories /mnt/fd0 and /mnt/fd1 are created if they don't exist. BUGS
Please send bug reports to: gnuit-dev@gnu.org SEE ALSO
gitfm(1) gitps(1) gitview(1) gitkeys(1) gitaction(1) gitrgrep(1) gitunpack(1) AUTHORS
Tudor Hulubei <tudor@cs.unh.edu> Andrei Pitis <pink@pub.ro> Ian Beckwith <ianb@erislabs.net> (Current maintainer) gitmount(1)
All times are GMT -4. The time now is 06:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy