Search : in
By :

How do I Write this shell script

Last answer on Oct 13, 2009 7:50:58 am BST seaman77, on Feb 16, 2009 7:05:19 am GMT 
 Report this message to moderators

Hello, please write this shell script
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. You write it this way:
echo "Usage: $0 filename"
You must check to see if the file exists; if it doesn't, give an error message. You must check to see if the file is a regular file; if not, give an appropriate message

Configuration: Crawler/Search Engine Indeterminable

Best answers for « How do I Write this shell script » in :
Shell script for telnet and run commands ShowShell script for telnet and run commands Issue Solution Note Issue I have made a shell script which can telnet automatically and run commands on the other machine and end the telnet session without any interact from the user, only he...
[Shell] Retrieving your public IP Show[Shell] Retrieving your public IP Implementation GET Lynx Sed For several reasons, we may need to recover its public IP address in a script. The problem that arises when you are on a LAN, is to find the IP without human...
How to read a file line by line ShowHow to read a file line by line Intro Tips Bonus Intro One of the most common errors of learning scripts bash on GNU / Linux is to read a file line by line, is to use a loop "for" (for line in $ (cat file.txt) do. ..), which in this...
Download Vista Live Shell Pack - Pink ShowIf you want to have Vista on your computer but your shape is not rather powerful or if simply you cannot have to be paid this version yet? Then resolution is to change the appearance of your good old XP. Vista Live Shell Pack is a topic of office...
Download SSH Secure Shell ShowSSH secure shell for workstations is a flexible client SSH allowing to connect in a secured way to remote applications. http://www.commentcamarche.net/faq/images/NHc6wz5jOYBhPXTis.png
Linux - The shell ShowIntroduction to the shell The command interpreter is the interface between the user and the operating system, hence the name "shell". The shell therefore acts as an intermediary between the operating system and the user thanks to command lines...
UNIX system - The shell ShowIntroduction to the shell The command interpreter is the interface between the user and the operating system, hence its name "shell". The shell therefore acts as an intermediary between the operating system and the user using command lines...
Using FTP commands ShowThe FTP protocol FTP (File Transfer Protocol) is a protocol — meaning a standard language that lets two machines communicate — used so that computers of different types (or with different operating systems) can transfer files over a...

1

jipicy, on Feb 16, 2009 6:19:09 pm GMT

Hi,

How do I Write this shell script?
Whith your fingers and your head !
$ man woman
Il n'y a pas de page de manuel pour woman.

Reply to jipicy

2

writer, on Mar 20, 2009 4:21:31 pm GMT
  • +5

Seams like he has some university homewroks to do :))

Reply to writer

3

 seaman77, on Mar 20, 2009 7:30:53 pm GMT
  • +2

This is my trying , there are problems in this script please help me to fix the proplems
#!/bin/bash

if [$# -eq 0]
then
echo ""
echo "error: you didn't entered a file nameafter script"
echo ""
exit 1
fi

if [$# -gt 1]
then
echo "error: you entered 2 files name or more"

echo "right syntax: ./execadd.sh file-name"
exit1
fi

if [$# -eq 1] && ls | grep= $1
then
sudo chmod 755 $1

echo "you have permission now on $1"
else
echo "file doesn't exict in this directory"
exit0
fi

Reply to seaman77