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 getFile(){ clear PS3="Please Select a File: " options=($(find -maxdepth 1 -print0|xargs -0)) select opt in "${options[@]}" "Quit"; do if (( REPLY == 1 + ${#options[@]})) then exit elif (( REPLY > 0 && REPLY <= ${#options[@]} )) then opt=$(basename $opt) echo "Your file is $opt" break else echo "Not a Valid option. Please Try again." fi done FILE="`pwd`/$opt" } if [ ! -f "$FILE" ] then while [ 1 ] do getFile [[ -d "$FILE" ]] && cd "$FILE" [[ -f "$FILE" ]] && break done fi cat "$FILE"
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)