nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Shell Script To converts letters to uppercase

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 ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Linux answers from nixCraft.


Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 22-02-2009, 01:58 PM
Junior Member
User
 
Join Date: Feb 2009
OS: fedora
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
seaman77 is on a distinguished road
Default Shell Script To converts letters to uppercase

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.
Reply With Quote
  #2 (permalink)  
Old 22-02-2009, 08:36 PM
Junior Member
User
 
Join Date: Feb 2008
OS: .
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
unSpawn is on a distinguished road
Default

Quote:
Originally Posted by seaman77 View Post
please help me to write this shell script and explain them
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/"; }
Reply With Quote
  #3 (permalink)  
Old 23-02-2009, 01:34 AM
Administrator
User
 
Join Date: Apr 2007
Posts: 15
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 10
root has disabled reputation
Default

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
Reply With Quote
  #4 (permalink)  
Old 23-02-2009, 12:28 PM
Junior Member
User
 
Join Date: Feb 2009
OS: fedora
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
seaman77 is on a distinguished road
Default thank u so much

I'm trying to solution them and I'will ask u if there are any problems
thank u so much.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

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


All times are GMT +5.5. The time now is 11:51 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38