User:Ptomusk

From ICO wiki
Revision as of 02:45, 15 October 2013 by Ptomusk (talk | contribs) (→‎Info)
Jump to navigationJump to search

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