Sponsored Content
Top Forums Shell Programming and Scripting Help on how to call a utility from script Post 302158905 by innocent on Wednesday 16th of January 2008 03:30:22 PM
Old 01-16-2008
Thks.I will try it & let you know.

/path/to/utility < /path/to/txt_file
input 1 ----is this step required?
input 2----is this step required?
EOF----is this step required?

I will write something like this. script based on ur advise as below.

xyz.sh
#! /bin/sh

/path/to/utility < /path/to/xyz.txt


xyz.txt will have
test (filename to be passed as a parameter)
01/01/2008
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

cdrdao utility script

friends, i love ya... i wrote a script to automate using cdrdao to burn an audio cd from mp3 files, using the great tutorial at http://tldp.org/HOWTO/MP3-CD-Burning/index.html (check out the site, i believe that it's very well-written). i messed around with it and got to a place where i felt... (2 Replies)
Discussion started by: snwright
2 Replies

2. Shell Programming and Scripting

sort utility in script ?

Hi friends, I want to use sort command in script. I used the following syntax in my scipt, sort -t '|' +3 tempcdrext4.cdr > temp.mocdr It give me a error " Input file specified two times." but this command work fine in the prompt without any problem. Can sombody please tell me who... (2 Replies)
Discussion started by: maheshsri
2 Replies

3. UNIX for Dummies Questions & Answers

Need help on SCRIPT(1M) utility

Hi All, I need to do a lot of manual entries at shell prompt. So to collect the logs(each command fired in that session, i use "SCRIPT(1) : make typescript of terminal session" this is kool,but the problem here is that it saves the linefeed, and backspaces along with the commands in the log... (1 Reply)
Discussion started by: amit4g
1 Replies

4. Shell Programming and Scripting

Writing a Utility Script

Hi All ,, I have couple of shell scripts .. I am trying to build a Utility script which would call each script example :: ======== 1) uni.sh 2) uni2.sh 3)uni3.sh when i run the Util script it will come as a menu ,, once i press 1 it will call the first shell script and runs it ..... (10 Replies)
Discussion started by: raghav1982
10 Replies

5. Shell Programming and Scripting

script not working...select utility

#!/usr/bin/bash name="$@" myname=malay #echo $myname select firstname in $name; do if ;then echo $firstname else break fi done invoking with:- ./script.sh one two three four five six seven eight nine malay (6 Replies)
Discussion started by: mobydick
6 Replies

6. Shell Programming and Scripting

I need help to run this utility from a shell script

I need some help to run this executable from within a shell script. The Script is run the following way at the command prompt. $rateupd Main Menu --Standard Output ----------- --Standard Output 1. - Update Rate --Standard Output 2. - Exit. --Standard Output Enter Selection: 1 --User... (5 Replies)
Discussion started by: rajeeb_d
5 Replies

7. Shell Programming and Scripting

Using sendmail utility in K Shell script

Hi, I am new to shell scripting and thus any help will be highly appreciated. I need to write a K shell script where in the email sending feature should be handled by sendmail utility and I have come up with the following : #!/usr/bin/ksh echo "This is a test mailest mail" | /usr/lib/sendmail... (4 Replies)
Discussion started by: sdiptanil
4 Replies

8. Homework & Coursework Questions

script similar to rm utility

1. The problem statement, all variables and given/known data: saferm is a replacement for the rm utility. Rather than removing files, it move files in a sub directoy called".saferm" in the user's home directory. If "~/.saferm" doesn't exist, it is automatically created. The -l options lists the ... (3 Replies)
Discussion started by: Joey12
3 Replies

9. UNIX for Advanced & Expert Users

which shell command or utility will call the net device driver?

Hi, all: Which shell command or utility will call the open(), close(), hard_start_xmit(), rtl8139_rx(), or interrupt() functions in a network device driver I am debugging? Can "ping", "ftp", "scp", or "internet browser" finally call them? Best regards! li, kunlun (0 Replies)
Discussion started by: liklstar
0 Replies

10. Shell Programming and Scripting

Script to automation utility app

Hi All, Am trying to write a shell script to automate one of the product utility but am struck with how to send/key in the inputs and most importantly it requires to press "Enter" key every time after giving the input. Not sure how to take control of utility from script and key in... (1 Reply)
Discussion started by: Optimus81
1 Replies
uux(1C) 						      Communication Commands							   uux(1C)

NAME
uux - UNIX-to-UNIX system command execution SYNOPSIS
uux [-] [-bcCjnprz] [-a name] [-g grade] [-s filename] [-x debug_level] command-string DESCRIPTION
The uux utility will gather zero or more files from various systems, execute a command on a specified system and then send standard output to a file on a specified system. Note: For security reasons, most installations limit the list of commands executable on behalf of an incoming request from uux, permitting only the receipt of mail (see mail(1)). (Remote execution permissions are defined in /etc/uucp/Permissions.) The command-string is made up of one or more arguments that look like a shell command line, except that the command and file names may be prefixed by system-name!. A null system-name is interpreted as the local system. File names may be one of the following: o An absolute path name. o A path name preceded by ~xxx, where xxx is a login name on the specified system and is replaced by that user's login directory. Anything else is prefixed by the current directory. As an example, the command: example% uux "!diff sys1!/home/dan/filename1 sys2!/a4/dan/filename2 > !~/dan/filename.diff" will get the filename1 and filename2 files from the sys1 and sys2 machines, execute a diff(1) command and put the results in filename.diff in the local PUBDIR/dan/ directory. PUBDIR is a public directory defined in the uucp source. By default, this directory is /var/spool/uucp- public. Any special shell characters (such as < > ; |) should be quoted either by quoting the entire command-string, or quoting the special charac- ters as individual arguments. The redirection operators >>, <<, >|, and >& cannot be used. uux will attempt to get all appropriate files to the specified system where they will be processed. For files that are output files, the file name must be escaped using parentheses. For example, the command: example% uux "a!cut -f1 b!/usr/filename > c!/usr/filename" gets /usr/filename from system b and sends it to system a, performs a cut command on that file and sends the result of the cut command to system c. uux will notify you if the requested command on the remote system was disallowed. This notification can be turned off by the -n option. The response comes by remote mail from the remote machine. OPTIONS
The following options are supported: - The standard input to uux is made the standard input to the command-string. -a name Uses name as the user job identification replacing the initiator user-id. (Notification will be returned to user-id name.) -b Returns whatever standard input was provided to the uux command if the exit status is non-zero. -c Does not copy local file to the spool directory for transfer to the remote machine (default). -C Forces the copy of local files to the spool directory for transfer. -g grade grade can be either a single letter, number, or a string of alphanumeric characters defining a service grade. The uuglist(1C) command determines whether it is appropriate to use the single letter, number, or a string of alphanumeric characters as a service grade. The output from the uuglist command will be a list of service grades that are available or a message that says to use a single letter or number as a grade of service. -j Outputs the jobid string on the standard output which is the job identification. This job identification can be used by uustat(1C) to obtain the status or terminate a job. -n Does not notify the user if the command fails. -p Same as -. The standard input to uux is made the standard input to the command-string. -r Does not start the file transfer, but just queues the job. -s filename Reports status of the transfer in filename. This option is accepted for compatibility, but it is ignored because it is insecure. -x debug_level Produces debugging output on the standard output. debug_level is a number between 0 and 9. As debug_level increases to 9, more detailed debugging information is given. -z Sends success notification to the user. ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of uux: LANG, LC_ALL, LC_CTYPE, LC_MES- SAGES, and NLSPATH. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. FILES
/etc/uucp/* other data and programs /etc/uucp/Permissions remote execution permissions /usr/lib/uucp/* other programs /var/spool/uucp spool directories ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWbnuu | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
cut(1), mail(1), uucp(1C), uuglist(1C), uustat(1C), attributes(5), environ(5), standards(5) NOTES
The execution of commands on remote systems takes place in an execution directory known to the uucp system. All files required for the execution will be put into this directory unless they already reside on that machine. Therefore, the simple file name (without path or machine reference) must be unique within the uux request. The following command will NOT work: example% uux "a!diff b!/home/dan/xyz c!/home/dan/xyz > !xyz.diff" But the command: example% uux "a!diff a!/home/dan/xyz c!/home/dan/xyz > !xyz.diff" will work (if diff is a permitted command.) Protected files and files that are in protected directories that are owned by the requester can be sent in commands using uux. However, if the requester is root, and the directory is not searchable by "other", the request will fail. The following restrictions apply to the shell pipeline processed by uux: o In gathering files from different systems, pathname expansion in not performed by uux. Thus, a request such as uux "c89 remsys!~/*.c" would attempt to copy the file named literally *.c to the local system. o Only the first command of a shell pipeline may have a system-name!. All other commands are executed on the system of the first command. o The use of the shell metacharacter * will probably not do what you want it to do. o The shell tokens << and >> are not implemented. o The redirection operators >>, <<, >|, and >& cannot be used. o The reserved word ! cannot be used at the head of the pipeline to modify the exit status. o Alias substitution is not performed. SunOS 5.11 28 Mar 1995 uux(1C)
All times are GMT -4. The time now is 10:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy