Basically, you can use multi-entry forms using Zenity. A form can be built using text fields, password fields, and calendars. Text fields can be added with the --add-entry
flag. Password fields are added with the --add-password
flag, and calandars are added with the --add-calendar
flag.
$ zenity --forms --title="Create user" --text="Add new user" \
--add-entry="First Name" \
--add-entry="Last Name" \
--add-entry="Username" \
--add-password="Password" \
--add-password="Confirm Password" \
--add-calendar="Expires"
Zenity form
Here is a tutorial that might help you out.
Paths with reserved names/characters:
LC_ALL=C find . -name '*[[:cntrl:]<>:"\\|?*]*' \
-o -iname 'CON' \
-o -iname 'PRN' \
-o -iname 'AUX' \
-o -iname 'NUL' \
-o -iname 'COM[1-9]' \
-o -iname 'LPT[1-9]' \
-o -name '* ' \
-o -name '?*.'
Test:
$ cd -- "$(mktemp --directory)"
$ touch foo \\ LPT9 'space ' 'dot.'
$ LC_ALL=C find . -name '*[[:cntrl:]<>:"\\|?*]*' -o -iname 'CON' -o -iname 'PRN' -o -iname 'AUX' -o -iname 'NUL' -o -iname 'COM[1-9]' -o -iname 'LPT[1-9]' -o -name '* ' -o -name '?*.'
./dot.
./space
./LPT9
./\
Paths which are identical when ignoring case (does not work with paths containing newlines):
find . | sort | LC_ALL=C tr '[:upper:]' '[:lower:]' | uniq -c | grep -v '^ 1 ' | cut -c '9-'
Test:
$ cd -- "$(mktemp --directory)"
$ touch foo bar BAR
$ find . | sort | LC_ALL=C tr '[:upper:]' '[:lower:]' | LC_ALL=C uniq -c | grep -v '^ 1 ' | cut -c '9-'
./bar
Paths longer than MAX_PATH
(260 characters):
find "$PWD" | while IFS= read -r path
do
if [ "${#path}" -gt 260 ]
then
printf '%s\n' "$path"
fi
done
Test:
$ cd -- "$(mktemp --directory)"
$ touch foo 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345
$ find "$PWD" | while IFS= read -r path
> do
> if [ "${#path}" -gt 260 ]
> then
> printf '%s\n' "$path"
> fi
> done
/tmp/tmp.HEANyAI8Hy/123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345
Best Answer
You could use another character that cannot appear in a file name:
/
so once you got your list of files you know that paths are separated by two slashes:
//
(the second being part of the path as each path starts with a slash but doesn't end with one). You could then use your favourite tool to turn the list into NUL separated paths...