User:Ptomusk: Difference between revisions

From ICO wiki
Jump to navigationJump to search
Ptomusk (talk | contribs)
Created page with "== Info == == Erinevate ainete raames lisatud sisu == === Skriptimiskeeled (I387) === ====Tunnis lahendatud näited==== '''Teine''' #Teha skript, mis küsib kasutajalt kataloogi …"
 
Ptomusk (talk | contribs)
Line 1: Line 1:
== Info ==
== Info ==
== Erinevate ainete raames lisatud sisu ==
== Erinevate ainete raames lisatud sisu ==
=== Skriptimiskeeled (I387) ===
=== Skriptimiskeeled (I387) ===

Revision as of 02:45, 15 October 2013

Info

Erinevate ainete raames lisatud sisu

Skriptimiskeeled (I387)

Tunnis lahendatud näited

Teine

  1. Teha skript, mis küsib kasutajalt kataloogi nime ja siis väljastab kõik (tavalised) failid/kaustad, mis seal kataloogis asuvad 3p

Ptomusk 14:29, 29 September 2013 (EEST)

#!/bin/bash
_short_help="`basename $0` [DIRECTORY]"
_long_help="Output the files in the specified directory"
if [ "$1" = '--help' ]; then
        echo $_short_help
        echo $_long_help
        exit 0
elif [ -d "$1" ]; then
	find "$1/" -maxdepth 1 -type f
else
	echo "No such directory!"
	echo $_short_help
	exit 1
fi

Link originaalpostitusele: Bash_quests_2013#Teine