Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #238223

Re: Bash script problem

From "Gary L. Roach" <garyroach719@gmail.com>
Newsgroups linux.debian.user
Subject Re: Bash script problem
Date 2021-08-05 22:10 +0200
Message-ID <CIRQJ-7vr-1@gated-at.bofh.it> (permalink)
References <CIyXL-4iY-1@gated-at.bofh.it> <CIG8V-m5-3@gated-at.bofh.it> <CIGVk-Ry-7@gated-at.bofh.it> <CIH4Z-UG-1@gated-at.bofh.it> <CIKcx-2Ph-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

hi all;

I really appreciate all of your help. The file now works. See attached. 
Now t0 answer some questions.

First, the IFS command sets the string separator. The default values are 
space /n and one other. The / is not among them. If I don't set the 
delimiter before I do the read, the whole string is read into the first 
array slot. Not what I want. Also, it may be bad practice to set this 
globally but if it starts to cause trouble later I can just reset it to 
the default values.

Second, why am I separating out the Path the way I am doing? I need to 
check each level for existence then, if the level doesn't exist, create 
the directory, cd to the directory, set chown and -x chmod. After that 
check the next level and repeat the process until I run out of levels. 
There are other things that need to be done with files that are similar.

I want to use this .sh file to automatically set up the Amanda backup 
system . I just got burned bad because of no backup.(dumb I know). I've 
had so much trouble setting up backup systems that I gave up the last 
time. I want to write this procedure once and store it away on a flash 
drive so that the next time I get a major crash I can pull out the flash 
drive and restore things easily. The code that I furnished is a test bed 
for part of the working file and will be incorporated into a function in 
the final program. My approach may not be very elegant but if it works, 
frankly, I don't care.

To all of you:  The problem, as several of you pointed out, was with the 
if statement syntax. It is now fixed and is working fine. A copy is 
attached.

All of you help has been sincerely appreciated.


Gary R.


Back to linux.debian.user | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Bash script problem "Gary L. Roach" <garyroach719@gmail.com> - 2021-08-05 02:00 +0200
  Re: Bash script problem Greg Wooledge <greg@wooledge.org> - 2021-08-05 02:10 +0200
    Re: Bash script problem "Gary L. Roach" <garyroach719@gmail.com> - 2021-08-05 05:50 +0200
      Re: Bash script problem john doe <johndoe65534@mail.com> - 2021-08-05 09:00 +0200
      Re: Bash script problem <tomas@tuxteam.de> - 2021-08-05 10:10 +0200
        Re: Bash script problem Greg Wooledge <greg@wooledge.org> - 2021-08-05 13:20 +0200
          test vs. [ [was: Bash script problem] <tomas@tuxteam.de> - 2021-08-05 14:00 +0200
            Re: test vs. [ [was: Bash script problem] Greg Wooledge <greg@wooledge.org> - 2021-08-05 14:40 +0200
              Re: test vs. [ [was: Bash script problem] <tomas@tuxteam.de> - 2021-08-05 15:00 +0200
      Re: Bash script problem Greg Wooledge <greg@wooledge.org> - 2021-08-05 14:30 +0200
  Re: Bash script problem Anssi Saari <as@sci.fi> - 2021-08-05 09:40 +0200
    Re: Bash script problem Tixy <tixy@yxit.co.uk> - 2021-08-05 10:30 +0200
      Re: Bash script problem <tomas@tuxteam.de> - 2021-08-05 10:40 +0200
        Re: Bash script problem Greg Wooledge <greg@wooledge.org> - 2021-08-05 14:00 +0200
          Re: Bash script problem "Gary L. Roach" <garyroach719@gmail.com> - 2021-08-05 22:10 +0200
            Re: Bash script problem Greg Wooledge <greg@wooledge.org> - 2021-08-05 22:20 +0200
              Re: Bash script problem "Gary L. Roach" <garyroach719@gmail.com> - 2021-08-06 17:00 +0200
                Re: Bash script problem <tomas@tuxteam.de> - 2021-08-06 17:10 +0200
            Re: Bash script problem David <bouncingcats@gmail.com> - 2021-08-06 01:40 +0200
              Re: Bash script problem Greg Wooledge <greg@wooledge.org> - 2021-08-06 02:10 +0200
                Re: Bash script problem Polyna-Maude Racicot-Summerside <debian@polynamaude.com> - 2021-08-06 02:20 +0200
                Re: Bash script problem Greg Wooledge <greg@wooledge.org> - 2021-08-06 02:30 +0200
                Re: Bash script problem The Wanderer <wanderer@fastmail.fm> - 2021-08-06 03:50 +0200
                Re: Bash script problem Greg Wooledge <greg@wooledge.org> - 2021-08-06 04:10 +0200
              Re: Bash script problem Polyna-Maude Racicot-Summerside <debian@polynamaude.com> - 2021-08-06 02:10 +0200
                Re: Bash script problem Christian Groessler <chris@groessler.org> - 2021-08-06 02:30 +0200
                Re: Bash script problem Christian Groessler <chris@groessler.org> - 2021-08-06 03:00 +0200
                Re: Bash script problem Greg Wooledge <greg@wooledge.org> - 2021-08-06 03:10 +0200
                Re: Bash script problem David <bouncingcats@gmail.com> - 2021-08-06 03:10 +0200
                Re: Bash script problem David <bouncingcats@gmail.com> - 2021-08-06 03:00 +0200
                Re: Bash script problem <tomas@tuxteam.de> - 2021-08-06 09:00 +0200
              Re: Bash script problem David Wright <deblis@lionunicorn.co.uk> - 2021-08-06 05:10 +0200
                Re: Bash script problem David <bouncingcats@gmail.com> - 2021-08-06 05:50 +0200
              Re: Bash script problem Darac Marjal <mailinglist@darac.org.uk> - 2021-08-06 09:20 +0200
  Re: Bash script problem Tom Browder <tom.browder@gmail.com> - 2021-08-06 01:00 +0200

csiph-web