If you want to restrict the input, this might work, except sed will want an extra linefeed:
This is a bit busier, but you see you can do almost anything in the $() to get the parameter. narrative: Capture the stdout of a subshell as a single parameter, set output_var blank, while output_var is blank, prompt for the parameter and read one line, saving it for error output. If the line is blank or has a forbidden character, it is rejected by displaying it including expansion of any control characters and looping back else echo it out of the subshell as the parameter:
Add " | tr '[a-z] '[A-Z]' " or
" | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' " for all caps -- there may be other more specific options and commands, but this general solution suffices and fits other needs, too. Since there is sed in the scripts above, it can be done at the end of the current sed script parameter.
Last edited by DGPickett; 10-15-2010 at 11:13 AM..
Reason: wrong sed capitalize command
In below script parameterwhich i am passing to awk function is not working.Not sure why its not accepting parameter.Please tell me how to pass parameter to the awk function.Please check the below script.
#!/bin/ksh
dummy_file=/etlapps/dev/data/sub_servicer_data/ScriptLogs/emp.txt
fields=5... (2 Replies)
Hi friends,
I am very new to Unix scripting and having some difficulty in my first shell script.
I have written a simple shell script to upload an artifact to a remote machine on the network.
echo "Uploading the artifact"
scp app.war username@remotemochine.domainname.net:/home/deployables... (3 Replies)
Hi I am trying to get my script to accept input regardless if the person enters a or A. here is the portion of the code where I get the input.
echo -n 'Please enter your choice:' # prompt user for input.
read reply # read input
echo
case $reply in #... (2 Replies)
I'm doing a script where you are suppose to start off in accepting one or more directory as an argument. How do i do this?
Sorry for the nub question. (2 Replies)
Hi,
I want to login to many systems and password should be taken automatically from a file(login is working but password is not accepting). Any help on this is appreciable .
My code.
for i in `cat /tmp/tes ` ====>tes file contain list of hosts
> do ssh $i
> perl prog.pl
>... (1 Reply)
I how do i accept a input date in script which is lesser than a specified day? ex: to accept a date less than or equal to 100 days(from today).?:(
Thanks for the help in advance.:) (1 Reply)
Hi,
I am new to UNIX. I am facing some problem here.
#! /usr/bin/ksh
currDate = $1
export currDate;
echo " Date is $currDate"
when I run this script, it says : currDate not found.
Can anybody point out the mistake please.
--mahek (3 Replies)
Hi UNIX guru's,
Have recently upgraded Oracle from 8i to 10g on an HP-UX (RISC) 11.11 box.
At least twice a day the database stops accepting incoming connections and the following errors are observed in the various logs.
The box needs to be rebooted to get everything going again.
The... (4 Replies)
I'm just starting out with UNIX and have figured some stuff out. I just need some help with accepting user input on the command line. For instance, I created a number counter that counts down from any positive hard coded number. But, I want the commnad line line to read "Countdown 20" where 20... (1 Reply)