For Statement Assignment Help

Assignment Help: >> Advanced Shell Scripts - For Statement

for statement

for statement executes the commands which are contained within do and done, a specified number of times.

Syntax

for variable in list-of-commands

do

commands

done

Practice 1

The given shell program will convert all the file content to uppercase begin with a as first name and through creating with similar file name and extension as caps.

# vi upperconv

for fname in ls a*

do

tr "[a-z]" "[A-Z]" < $fname > $fname.caps

done

# sh upperconv

The given program will search the filename that begins with a as the first letter and open the file ID will then convert the whole file content into uppercase and store it in a file with the similar filename but with extension in caps.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd