Sponsored Content
Top Forums Shell Programming and Scripting How to take input from the user from the command line and execute commands basedon that? Post 302649727 by jlliagre on Friday 1st of June 2012 03:26:29 AM
Old 06-01-2012
Quote:
Originally Posted by muraliinfy04
Thanks for your input.yeah I have remove that.
It is unclear what your script looks like now. Please post its current full source.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Can Xargs execute multiple commands of evry input file

Hello , I am trying to print the footer of evry file in the given directory with xargs command like follows ls -1 | xargs -I {} gzcat {} | tail -1 now problem with this is only last file foooter is getting printed as " | tail -1 " is getting executed for the last file. I know this can... (4 Replies)
Discussion started by: nilesrex
4 Replies

2. Shell Programming and Scripting

How to restrict the number of commands user can execute

Hi all, Is there a way to prevent users from being able to execute commands less a select few? For instance, I wish to allow the user to be only able to execute 1 command, which is exec a.sh. He should not be able to do simple stuff such as ls, cd, rm, cat, etc. Can this be achieved? ... (1 Reply)
Discussion started by: rockysfr
1 Replies

3. Shell Programming and Scripting

root user command in shell script execute as normal user

Hi All I have written one shell script for GPRS route add is given below named GPRSRouteSet.sh URL="www.google.com" VBURL="10.5.2.211" echo "Setting route for $URL for GPRS" URL_Address=`nslookup $URL|grep Address:|grep -v "#"|awk -F " " '{print $2}'|head -1` echo "Executing ... (3 Replies)
Discussion started by: mnmonu
3 Replies

4. Shell Programming and Scripting

Execute commands to specific folder from input file

Hi, I have one text file input.txt, which has folders path as follows: /home/user/automate/abc /home/user/automate/abc/xyz /home/user/automate/test /home/user/automate/test2 /home/user/automate/test2/abc/Main In those folders i have .svn folder. 1) First i want to remove .svn like rm... (5 Replies)
Discussion started by: dragon.1431
5 Replies

5. Shell Programming and Scripting

Command to execute commands one after other

I am writng a script in which there is an installation file.The installer runs good. But after the installer command there are some files and commands which are based on those installed files. Now problem is the commands get executed before the installer is totally installed. So is there any... (5 Replies)
Discussion started by: sriki32
5 Replies

6. Shell Programming and Scripting

Command line user input validation

Hi guys, I have a piece of snippet below which asks the user to input some numbers if isDatasubEnabled && isReconEnabled; then echo "1 = CGT, 2 = Subscriber, 3 = Order Monitor, 4 = Revaluations, 5 = Reconciliation, 6 = All, 7 = Exit" elif isDatasubEnabled &&... (4 Replies)
Discussion started by: pyscho
4 Replies

7. Shell Programming and Scripting

Script for login to servers with user name and password and execute commands

I am having the 15 servers which need to do the monitoring Hi I need a shell script, By which i can log in to multiple servers and execute the commands.. I need to specify the username and password in the scripts. Please help me to write the script so that it can login with username and... (5 Replies)
Discussion started by: nandan8a
5 Replies

8. Shell Programming and Scripting

Reading ls -l output line by line awk the user name and su user to run commands

Using ksh on AIX what I am trying to do is to read the ls -l output from a file in a do while loop line by line. Extract the user name(3rd field) and the directory/file name(9th field) using awk and save them into variables. su -c to the user and change directory/file permisions to 777. Script I... (13 Replies)
Discussion started by: zubairom
13 Replies

9. Shell Programming and Scripting

Execute a command with root user

i m logged in with user1 id. i wish to execute the below as root user for which i tried several commands but all of them fail. sudo 'cat /tmp/tmp.file >>/etc/logger' Password: sudo: cat /tmp/tmp.file >>/etc/logger: command not found sudo cat /tmp/tmp.file >>/etc/logger bash:... (5 Replies)
Discussion started by: mohtashims
5 Replies

10. Shell Programming and Scripting

Execute ssh command with additional terminal command to any remote user not working script

Hello i am having an issue with bash script and this is the code now=$(cat hosts1.txt | awk '{print $2;}') while read n ;do ssh root@$now 'useradd test1; echo -e "test1\ntest1" | passwd test1 && echo "test1 ALL=(ALL:ALL) ALL" >> /etc/sudoers' When i execute only part with cat, it... (8 Replies)
Discussion started by: tomislav91
8 Replies
GENCAT(1)						    BSD General Commands Manual 						 GENCAT(1)

NAME
gencat -- generates a Native Language Support (NLS) message catalog file SYNOPSIS
gencat catfile [msgfile|- ...] DESCRIPTION
The gencat utility generates a formatted message catalog catfile from stdin or one or more message source text files msgfile. The file catfile is created if it does not already exist. If catfile does exist, its messages are included in the new catfile. The new message text defined in msgfile replaces the old message text currently in catfile when the set and message numbers match. The generated message catalog contains message strings that will be retrieved using the catgets(3) library call. These messages are dynami- cally loaded by the Native Language Support (NLS) library at run time. Error messages are grouped into sets, and a program can load a par- ticular set depending on which type, or language, of messages is desired. Message Text Source File Format The message text source files are text files in the format described below. Note that the fields of a message text source line are separated by space or tab characters. $set n comment Determines the set identifier to be used for all subsequent messages until the next $set or end-of-file. The n is the set identifier which is defined as a number in the range [1, NL_SETMAX]. Set identifiers within a single source file need not be contiguous. Any string following the set identifier is treated as a comment. If no $set directive is specified in a message text source file, all mes- sages will be located in the default message set NL_SETD. $delset n comment Removes message set n from the catalog. The n is a set identifier in the range [1, NL_SETMAX]. If a message set was created earlier in the current file, or in a file previously read by the gencat command, this directive will remove it. Any string following the set iden- tifier is treated as a comment. $ comment A line beginning with $ followed by a space or tab character is treated as a comment. m message-text A message line consists of a message identifier m in the range [1, NL_MSGMAX] and the message-text. The message-text is read until the end of the line or a quote character (if one is specified). The message-text is stored in the message catalog with the set identifier specified by the last $set directive, and the message identifier m. If the message-text is empty and there is a space or tab character following the message identifier, an empty string is stored in the message catalog. If no message-text is provided, and if there is no space or tab character following the message identifier, the message with the message identifier m in the current set is removed from the catalog. Message identifiers need not be contiguous within a single set. The length of message-text must be in the range [0, NL_TEXTMAX]. $quote c Sets an optional quote character to be used around the message-text. The quote character c may be any character other than white space. If this is specified, then messages must begin and end with the quote character. This is useful when messages must contain leading white space. By default no quote character is used. If an empty $quote directive is specified, then the current quote character is unset. Empty lines and leading blanks in a message text source file are ignored. Any line beginning with any character other than those described above is ignored as a syntax error. Text message strings may contain any characters and the following special characters and escape sequences. Description Symbol Sequence newline NL(LF) horizontal tab HT vertical tab VT v backspace BS  carriage return CR form feed FF f backslash \ bit pattern ddd ddd A bit pattern, ddd, consists of a backslash followed by one, two, or three octal digits representing the value of the character. The cur- rent quote character, if defined, may be escaped with a backslash to generate the quote character. Any character following the backslash ('') other than those specified is ignored. A backslash at the end of the line continues the message onto the next line. The following two lines are an example of such a message: 1 This message continues on the next line Producing the following message: 1 This message continues on the next line EXIT STATUS
The gencat utility exits 0 on success, and >0 if an error occurs. SEE ALSO
catclose(3), catgets(3), catopen(3), nls(7) AUTHORS
The Native Language Support (NLS) message catalog facility was contributed by J.T. Conklin <jtc@NetBSD.org>. This page was originally writ- ten by Kee Hinckley <nazgul@somewhere.com>. BSD
December 29, 2011 BSD
All times are GMT -4. The time now is 01:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy