I want to use the read command in order to input a keyword from the keyboard.
I then want to use this keyword in a grep command.
How to I input a phrase as a keyword? For example if I use
and then use grep, I get "No such file or directory" error.
Hi All,
I wish to automate the unix command 'su' through a shell script.
I would like to pass the content of a file as password to 'su' command.
My script is as below,
#! /bin/sh
su userA
while read line
do
rpm -ivh $line
done < pwd.txt
where pwd.txt contains the password of... (6 Replies)
I need to write a bourne shell script (solaris 10) that accepts input from the user. The input will be a command- any command like ls/ pwd/ mv etc. After the input is read, the shell must execute the command supplied by the user.
I know we use read to play with user inputs. Just not sure how to... (2 Replies)
I need help understanding a script I'm modifying which someone else has written. Basically I’m looping through a buffer that holds records fetched from a database query. I need a way to separate the primary key values from other attributes in the result. Heres the code:
BUFF=buffer_file
>... (5 Replies)
Hi everyone, i have made a very simple script where it reads the user input and converts the number from celcius to faranheit but instead of running the command and prompting the user for input I want to be able to simply enter a number at the end of the command to run the script.
ex. instead of... (1 Reply)
Hi All,
Do we know how to read input file within awk script and send output toanother log file. All this needs to be in awk script, not in command line. I am running this awk through crontab.
Cat my.awk
#!/bin/awk -f
function test(var){
some code}
{
}
END
{
print"test code"
} (5 Replies)
Hi,
I want to write a small code in which script changes command line input to some form.
Example
script.sh a1 a2 a3 a4 .....
output should be "a1|a2|a3|....."
Number of inputs in command line can be any variable (2 Replies)
Dear Friends,
I am looking for a shell script to merge input files into one file .. here is my idea:
1st paramter would be outfile file (all input files content)
read all input files and merge them to input param 1
ex: if I pass 6 file names to the script then 1st file name as output file... (4 Replies)
Team ,
I am trying to write a case condition for database backups.But I am unable to make the script to read input from command line .
while true ;do
read -p "Do You Wish To Take Database Backup ?? " yn
case $yn in
*) echo " YES take backup ";;
*) echo " NO BACKUP " ;;
... (9 Replies)
Hi,
i am working on one automation , for that i have writing one shell program that take user input in "while read line" block. but read command is taking value that is readed by While block.
while read line; do
command 1;
command 2
echo -n "Do you want to continute > "
read rsp... (2 Replies)
Discussion started by: ranvijaidba
2 Replies
LEARN ABOUT ULTRIX
ptx
ptx(1) General Commands Manual ptx(1)Name
ptx - create permuted index
Syntax
ptx [option...] [input[output]]
Description
The command generates a permuted index to file input on file output (standard input and output default). It has three phases: the first
does the permutation, generating one line for each keyword in an input line. The keyword is rotated to the front. The permuted file is
then sorted. Finally, the sorted lines are rotated so the keyword comes at the middle of the page. The command produces output in the
form:
.xx "tail" "before keyword" "keyword and after" "head"
where .xx may be an or macro for user-defined formatting. The before keyword and keyword and after fields incorporate as much of the line
as fits around the keyword when it is printed at the middle of the page. The and commands, at least one of which is an empty string "",
are wrapped-around pieces small enough to fit in the unused space at the opposite end of the line. When original text must be discarded,
`/' marks the spot.
Options
The following options can be applied:
-b break Use the characters in the break file as separators. In any case, tab, new line, and space characters are always used
as break characters.
-f Folds upper and lower case letters for sorting.
-g n Uses specified number as interfield gap. The default gap is 3 characters.
-i ignore Do not use as keywords any words given in the ignore file. If the -i and -o options are missing, use /usr/lib/eign as
the ignore file.
-o only Use words listed only in the only file.
-r Uses leading nonblanks as reference identifiers. Attach that identifier as a 5th field on each output line.
-t Prepares the output for the phototypesetter. The default line length is 100 characters.
-w n Use the next argument, n, as the width of the output line. The default line length is 72 characters.
Restrictions
Line length counts do not account for overstriking or proportional spacing.
Files
/usr/bin/sort
/usr/lib/eign
ptx(1)