Автоматически блокировать экран, не отключая его

Плакат сверху спросил, что я снова отправлю свой ответ в качестве фактического ответа для потомков. Вот ответ. Спасибо всем за вашу помощь.

Я ответил на свой вопрос. Вот сценарий bash, который, кажется, делает трюк. Я бы рад помочь оценить, почему код, который я прокомментировал, не работает ...

#!/bin/bash
# Created by Dave, 2012-02-23
# This script uses PDFtk to password protect every PDF file
# in the directory specified. The script creates a directory named     "protected_[DATE]"
# to hold the password protected version of the files.
# 
# I'm using the "user_pw" parameter, 
# which means no one will be able to open or view the file without
# the password.
#
# PDFtk must be installed for this script to work.
#
# Usage: ./protect_with_pdftk.bsh [FILE(S)]
# [FILE(S)] can use wildcard expansion (e.g., *.pdf)

# This part isn't working.... ignore. The goal is to avoid errors if the
# directory to be created already exists by only attempting to create
# it if it doesn't exists
#
#TARGET_DIR="protected_$(date +%F)"
#if [ -d "$TARGET_DIR" ]
#then
#echo   # echo "$TARGET_DIR directory exists!"
#else
#echo   # echo "$TARGET_DIR directory does not exist!"
#fi
#

mkdir protected_$(date +%F) 
for i in *pdf ; do pdftk "$i" output "./protected_$(date +%F)/$i" user_pw    [PASSWORD]; done 
echo "Complete. Output is in the directory: ./protected_$(date +%F)"
1
задан 16 June 2013 в 16:52

0 ответов

Другие вопросы по тегам:

Похожие вопросы: