Skip to content
Advertisement

Tag: ksh

KSH shell that counts lines of files in directory

This is the prompt: Write a Korn shell script (and show the code for it here) that will determine which file in a directory has the maximum number of lines (this may be different than the file that has the maximum number of bytes). After determining the file with the maximum number of lines, the script will print out the

Creating Linux Alias to list only Directories

I’m wanting to create an alias called dir for KSH that will show only the sub-directories in a cluttered directory with many files and directories. I can output a single-column list of the directories, but I am having a problem converting the single-column list into a multi-column. I want it to automatically determine the number of columns to use based

ksh/bash run command line from variable

I set in cmd variable the find syntax: , I use ksh shell/bash so why when I want to run the cmd as the following I not actually activate the find … it’s also not works when I run with double brackets what is the resolution for this? Remark I not want to set the cmd like this ( this

Check if a directory exists and is accessible

I want to check if a directory exists and it has access rights; if it does, then perform the tasks. This is the code I wrote, which might not have proper syntax. Can you help me to correct it? I believe this can also be written like this. How can we write this more efficiently? Answer The best way to

Advertisement