Shell script that accepts one or more file name as arguments and converts all of them to uppercase, provided they exist in the current directory

# get filename echo -n "Enter File Name : " read fileName # make sure file exits for reading if [ ! -f $fileName ] then echo "Filename $fileName does…

Continue ReadingShell script that accepts one or more file name as arguments and converts all of them to uppercase, provided they exist in the current directory

Shell script that takes a command –line argument and reports on whether it is directory, a file, or something else

echo " enter file" read str if test -f $str then echo "file exists n it is an ordinary file" elif test -d $str then echo "directory file" else echo…

Continue ReadingShell script that takes a command –line argument and reports on whether it is directory, a file, or something else

C program that takes one or more file or directory names as command line input and reports the following information on the file: i)File type ii)Number of links iii)Read, write and execute permissions iv)Time of last access

#include #include #include #include #include void main() { int fd; struct stat buf; fd=open("f5.txt",O_RDONLY|O_CREAT,600); if(fd!=-1) { if(fstat(fd,&buf)==0) { printf("mode of fileis %u",buf.st_mode); printf("n size of the file is %u",buf.st_size); printf("n…

Continue ReadingC program that takes one or more file or directory names as command line input and reports the following information on the file: i)File type ii)Number of links iii)Read, write and execute permissions iv)Time of last access