Design and Develop a shell script which removes empty files from PWD and changes other files
AIM:
Design and Develop a shell script which removes empty files from PWD and changes other files
Program:
Times stamps to current time # !/bin/sh for x in do if [-f $x ] then if [-s $x ] then touch $x else rm $x fi fi done
Output:
Student@ubuntu:~$cat f1 ^z Student@ubuntu:~$ sh rmf.sh f1 Student@ubuntu:~$cat f1 Cat:f1:No such file or Directory
-
UpdatedOct 23, 2014
-
Views2,492
You May Like
Write a Shell script to find factorial of a given integer.
Write in C the following Unix commands using system calls A). cat B). ls C). mv
Write a Shell script that displays list of all the files in the current directory to which the user has read, Write and execute permissions.
Write a Shell script that accepts a filename, starting and ending line numbers as arguments and displays all the lines between the given line numbers.
Write a C program to emulate the Unix ls-l command.
Write a Shell script to list all of the directory files in a directory.