Linux / UNIX Tech Support Forum
This is a discussion on Shell Script To converts letters to uppercase within the Shell scripting forums, part of the Development/Scripting category; Hello, I'm new in linux, please help me to write this shell script and explain them 1- Write a shell ...
|
|||||||
| Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hello, I'm new in linux, please help me to write this shell script and explain them
1- Write a shell script (trans.sh) that : - Take as command-line options any number of text files -Read in each of these files, converts all the letters to uppercase, and then stores the results in a file of the same name but with a .caps extension 2- Write a script (execadd.sh) that will take a single filename as an argument and adds execute permission to the file for the user, but only if the file is a regular file. Your script must check to see that there is exactly one argument. If there are no arguments or more than one arguments, your script must produce a "usage" message that tells how to use the script. |
| Sponsored Links | ||
|
|
|
|||
|
Sure. Help is on the way. Try:
Code:
function help() { echo "Bash scripting guides:
http://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
http://www.tldp.org/LDP/Bash-Beginners-Guide/html/index.html
http://www.tldp.org/LDP/abs/html/"; }
|
|
|||
|
No one is going to complete your school work; I suggest you post whatever work (code) you've done and describe the problem ; so that others can provide the help.
tr command can be used to solve first problem : Shell Script To Translate All Characters In a File To Lowercase Use if command and test command to see if file executable or not ... Code:
usage(){
echo "Usage: $0 filenane"
}
file=$1
[ $# -eq 0 ] && usage
if [ ! -x $file ]
then
chmod +x $file
fi
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| GUI shell script for Linux | mr_aliagha | Shell scripting | 2 | 06-12-2008 02:30 AM |
| shell script for ftp | chaharvikram | Shell scripting | 0 | 09-10-2008 06:24 PM |
| Binary Conversion Of Shell Script (shell script compiler) | chandanperl | Shell scripting | 3 | 29-07-2008 10:22 AM |
| Shell script needed | supamaka | Shell scripting | 3 | 14-06-2008 01:46 AM |
| writing a shell script to find out my shell name | jaymob123 | Shell scripting | 1 | 08-10-2007 12:36 AM |