Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: script superuser permission problem

  1. #11

    Default Re: script superuser permission problem

    Quote Originally Posted by lord_valarian View Post
    I'm stuck. This loop is a common used structure for doing something only once. I'm trying to read the first two lines of the output. Then read it word by word. I’ve tried using numbers instead, that didn't work either. I want to leave out arrays for now. Can you fix this code? I need to understand what i'm doing wrong. Thanks


    Code:
             while read -r line; do 
               scanvirus_flag="false"           scanvirus_flag=0
               if  [ "$scanvirus_flag" = "false" ]; then         #if [ scanvirus_flag=0]; then
                 scanvirus_flag="true"        #scanvirus_flag=1
                 printf "%s\n" $line
                 read -r line
                 printf "%s\n" $line
                 read -r line
                 break
               fi
    
    #           if [ "$parm_device" = "*--------------------*" ]; then
    #               read -r parm_device
    #           fi
    #          printf "%s " $parm_device
               
    #           read -r parm_file_system_type
    #           printf "%s " $parm_file_system_type
               
    #           read -r parm_label
    #           printf "%s " $parm_label
    
    #          read -r parm_mount_point
    #           if [ "$parm_mount_point" = "(not" ] || [ "$parm_mount_point" = "(in" ]; then
    #             printf "%s " $parm_mount_point
    #             read -r parm_mount_point
    #             printf "%s " $parm_mount_point
    #           else
    #             printf "%s " $parm_mount_point
    #           fi
        
    #           read -r parm_uuid
    #           printf "%s\n" $parm_uuid
       
             done < <(blkid -o list)
    Hi,

    It seems every time you're question is changing whenever i have an answer

    Now instead of code that even you cannot understand what is happening (which is your own code)
    Why not just ask and explain what are you really trying to do.
    "Unfortunately time is always against us" -- [Morpheus]

    .:https://github.com/Jetchisel:.

  2. #12

    Default Re: script superuser permission problem

    It seems every time you're question is changing whenever i have an answer

    Now instead of code that even you cannot understand what is happening (which is your own code)
    Why not just ask and explain what are you really trying to do.
    I've been programing a very long time. For general programing experience and training, I know nearly every skill and technical debugging. Bash scripting is totally new to me. How is not a problem. The specific commands to get the job done on sections of code are the problem. Your snips of very useful, but sometimes i'm confused what your doing. I can't use snips, if I don't understand how they work or what they do. I'm learning it as go. My mind is always three steps ahead for the formula as whole.

    Thanks to you for all those snips. Also, the bug in that code was a novice error. One of those DUH! moments... I will not speak of it....

    I'v fixed that bug. I'm going to use word array code snip to parse the output. Then use that to mount, scan, and unmount. I'll post on here if I need help again. I just need the time to write out the new code.

  3. #13

    Default Re: script superuser permission problem

    Quote Originally Posted by lord_valarian View Post
    I've been programing a very long time. For general programing experience and training, I know nearly every skill and technical debugging. Bash scripting is totally new to me. How is not a problem. The specific commands to get the job done on sections of code are the problem. Your snips of very useful, but sometimes i'm confused what your doing. I can't use snips, if I don't understand how they work or what they do. I'm learning it as go. My mind is always three steps ahead for the formula as whole.

    Thanks to you for all those snips. Also, the bug in that code was a novice error. One of those DUH! moments... I will not speak of it....

    I'v fixed that bug. I'm going to use word array code snip to parse the output. Then use that to mount, scan, and unmount. I'll post on here if I need help again. I just need the time to write out the new code.

    Hi,

    I don't doubt your experience in programming also I'm willing to give some handholding along the way if need be
    but for us to make progress we should be on the same page otherwise we will be going on like an infinite loop.
    "Unfortunately time is always against us" -- [Morpheus]

    .:https://github.com/Jetchisel:.

  4. #14

    Default Re: script superuser permission problem

    Quote Originally Posted by jetchisel View Post
    Hi,

    I don't doubt your experience in programming also I'm willing to give some handholding along the way if need be
    but for us to make progress we should be on the same page otherwise we will be going on like an infinite loop.

    I saved the whole page as reference, adding to very crowded "opensuse tech folder". Every bit of hand holding is helpful.
    Linux bash is all new to me. Each programing language is has slightly different structure, but general programing use the same basic structure and debugging code. This is how many I know. For reference, but not bragging.

    Basic (interpreter ATARI 8-BIT), ASM MAC/65 and ACTION! (ATARI 8-BIT), ADA, Pascal, and C. Each one has it's quirks, including Linux bash. Like the syntax errors aren't always on the line shown. Missing or 3 quotes in one line are a joy to find and fix... (sarcasm)

    Good news: The whole script works now. It finds and scans all vfat and ntfs file systems, no need for user files. It found a possible virus in my MSWIN764 system. Which I waited to reboot and scan using my win scanners. OPPS, didn't delete right away. see next line. Need to write control-c trap I found, refine instructions, fix superuser and script access issues. ".snapshots"? (excluded)

    Bad news: my win system boots (on grub2 - click win) to "boot loader not found". My linux system works as normal, no click boot to windoze (again - rolling eyes). So, I need to figure out what went haywire, attempt system recovery: how much damage is there and how to fix it. Maybe just quick linux boot loader fix or complete win install or total recovery after retrieving data files. Keep my win7 installer from destroying my Linux partions again.

    This current problem is fixed. I'll post again, once I decode what's wrong with windoze. Thank you once again for your hand holding posts. I do it in a different format for coding than you, but it's all the same in results.


    To all: It's neat, clean, and easy to read, one self-contained script for all functions needed. It will setup icons on your desktop. I'll put a creative common license on release version.

Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •