Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#!/bin/bash #created by Kris Occhipinti - https://filmsbykris.com #Fri Feb 9 2018 #Licensed under GPLv3 - https://www.gnu.org/licenses/gpl-3.0.txt ### This script converts all pdf files in a given dir to a one line text file for quick searching ### dir="/home/user/Documents" output="/home/user/.docsearch" func="$1" q="$*" if [ "$#" -lt "1" ] then echo "Input needed." echo "To update: $0 update" echo "To search: $0 mazda" exit 1 fi function update(){ find "$dir" -iname "*.pdf"|while read pdf; do echo -n "${pdf}|"; pdftotext "$pdf" - |sed ':a;N;$!ba;s/\n/ /g'; echo ""; done > "$output" } function main(){ if [ "$func" = "update" ] then update; else echo "Searching for $q" grep -i "$q" "$output"|cut -d\| -f1 fi } main
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)