Help for this page

Select Code to Download


  1. or download this
    touch /a/b/c/d1
    
  2. or download this
    mkdir -p /tmp/a/b/c
    cp /a/b/c/d1 /tmp/a/b/c
    # Or: rsync -a $USER@MACHINE:/a/b/c/d1 /tmp/a/b/c
    
  3. or download this
    sub escape {         
        my ($path) = @_;                        
    ...
        }
        return $path;
    }
    
  4. or download this
    sub escape {         
        my ($path) = @_;                        
    ...
        $new_path =~ s/\\\//\//g;
        return $new_path;
    }
    
  5. or download this
    foreach my $dir (sort(keys(%dirs))) {
        $dir = escape($dir);
    ...
        $parent_dir = wrap_with_quotes($parent_dir);
        print("rsync -a $host$abs_path /tmp/$parent_dir\n");
    }
    
  6. or download this
    declare -a special_chars=("!" "@" "#" "$" "%" "^" "_" "-" "=" "+" "[" 
    +"]" "(" ")" "{" "}" "'" ":" "," "." ";" " " "\"" "<" ">")
    
    ...
            fi
        done
    fi