Sponsored Content
Top Forums Shell Programming and Scripting How to check the user input to be valid using shell script? Post 302774465 by hyeewang on Saturday 2nd of March 2013 12:35:48 AM
Old 03-02-2013
Thank you 2.
I got your idea although I can not run your code due to compile error.
Is there any convenient command to convert or substitute "rwxr-xr-x" to be "111101101"?
That means "change "r","w","x" to be "1", "-" to be "0".
After that, I want to change binary to octal format by "bc"? Is it a good method by "bc"?
I am a beginner. thanks for help.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to check for a valid numeric input

Hi Folks, I'm using bash script. I would like to check whether input is a number or not.(Only positive numbers).. if space or non numeric is entered, it should say "invalid input". pls help.. thanks in adv. Br/// Vijay. (1 Reply)
Discussion started by: Vijayakumarpc
1 Replies

2. Shell Programming and Scripting

SQL PLUS Command 'ACCEPT' is not waiting for user input with sh shell script

Dear All, The sqlplus 'Accept' command is not waiting for user input when I include the command within a shell script. Note: The 'Accept' command is working fine if I execute it in a SQLPLUS Prompt. Please fins the below sample script which i tried. SCRIPT: -------- #!... (4 Replies)
Discussion started by: little_wonder
4 Replies

3. Shell Programming and Scripting

User Input Shell Script

Hello I am trying to create a user input shell scipt. The objective is user should enter the circuit number and the input is saved in a log file. If the user does not enter anything then the question should prompt it until the circuit no. is entered. Can any one please correct the code below.... (3 Replies)
Discussion started by: sureshcisco
3 Replies

4. Shell Programming and Scripting

shell script to take input from a text file and perform check on each servers and copy files

HI all, I want to script where all the server names will be in a text file like server1 server2 server3 . and the script should take servernames from a text file and perform copy of files if the files are not present on those servers.after which it should take next servername till the end of... (0 Replies)
Discussion started by: joseph.dmello
0 Replies

5. Homework & Coursework Questions

Bash shell - Check if value is valid directory.

1. The problem statement, all variables and given/known data: The script usage will be as follows: library.third source_directory - Your script will display an appropriate error message and exit with status 3 if no parameters are given - Your script will display an appropriate error... (2 Replies)
Discussion started by: netmaster
2 Replies

6. Shell Programming and Scripting

How to get the user input recursively until the user provides valid input

Hi, echo "Enter file name of input file list along with absolute path : " read inputFileList if then for string in `cat inputFileList` do echo $string done else echo " file does not exist" fi From the above code, if the user enters a invalid file... (1 Reply)
Discussion started by: i.srini89
1 Replies

7. Shell Programming and Scripting

create an array which can store the strings from the user input in shell script

I want to create an array which can store the strings from the user input in shell script . example :- I want to store the 5 fruits name in a single array which the user provides . (1 Reply)
Discussion started by: Pkast
1 Replies

8. Shell Programming and Scripting

Shell script to accept user input on the fly

I want a shell script that accepts user input simultaneously when performing other tasks. Example: A shell script should echo some messages on the console and when the user presses some keys it should respond to that action. say, when user presses the key A - more information should be printed... (2 Replies)
Discussion started by: Arun_Linux
2 Replies

9. Shell Programming and Scripting

Need a script to check if an argument is valid shell variable

I need a script that should print 'yes' if the argument is a valid shell variable name else 'No' if it is not a valid shell variable. A valid one begins with an alphabet or percentage (%) character and is followed by zero or more alphanumberic or percentage (%) characters. For example: $... (6 Replies)
Discussion started by: pingiliarjun
6 Replies

10. Shell Programming and Scripting

Recording user input from interactive shell script

Hello, I want to start out by saying that I am fairly new to scripting and am looking for someone that can point me in the right direction. Basically what I need is a way to run a interactive script that will prompt users with questions weather that be yes/no or a specific answer.. I want to be... (3 Replies)
Discussion started by: shoutcast
3 Replies
INSTALL(1)						      General Commands Manual							INSTALL(1)

NAME
install - install files SYNOPSIS
install [-lcszN] [-o owner] [-g group] [-m mode] [-S stack] [file1] file2 install [-lcszN] [-o owner] [-g group] [-m mode] [-S stack] file ... dir install -d [-o owner] [-g group] [-m mode] directory DESCRIPTION
Install puts executables, manual pages, and library files in their proper place in the bin, man, and lib directories. The first two forms of the command are like cp(1) copying either one file to another or copying several files to a directory. The "-d" form is like mkdir(1) with the -p flag. File1 may be omitted if neither -l nor -c is given to change the attributes of file2. Attributes are always copied from the source file, use the options to change. Note that the source file's attributes are changed with the destination file if they are linked. So copy the file if you change it in a way that makes it read-only. You would otherwise not be able to compile a command again. OPTIONS
-l Link the destination to the source file instead of copying it. This is done to either save space on a file system with both the source and the bin directories on it, or to install synonyms to a command. -c Copy the source file to its proper place. This option is the default if -l is not given. With -l, the file is copied if the link fails. -s Strip the destination file of its symbol table, if it is an executable, and if it is actually copied. It has no effect on a link or a non-executable. -z Compress the executable using compress(1) and prepend a header line that calls zexec(1) to decompress and execute the binary. This will on average save 40% disk space at the expense of a slower startup time. Like -s the file must be actually copied for the flag to have effect. -N Use gzip -N to compress the binary. You may see up to 60% space savings, but it will take much longer. N is a digit from 1 to 9 telling the compression effort, see gzip(1). -d Make a directory, usually to install files in a separate directory in a library. Intermediate directories in the path are created with the same attributes as the final directory. Only the attributes of the final directory are set if the directory exists. -o owner Set the owner of the target. This only works if the invoker is the super-user, or if install is run setuid root and the invoker is a member of group zero. If -o is omitted then the ownership is copied from the source file, or set to the id of the invoker if a directory is made. -g group Like -o, but for the group ownership of the target. -m mode Mode is an octal number that specifies the mode the target should get. The default is the source file's mode with a chmod a+rX applied to it, or 755 for a new directory. Implies -o 0, or -g 0 if a file is to be set-uid or set-gid and the invoker has permis- sion to change ownership. This trick allows a group 0 member to install third party software, even though it expects to be installed by root. -S stack Sets the maximum amount of heap + stack that an executable may have when running. The argument is a C-style decimal, octal or hexa- decimal number, optionally followed by the multipliers m, k, w, and b for mega (1024*1024), kilo (1024), "word" (2 or 4), and byte (1). Uppercase M is also accepted for those who know what S.I. means. The compilers use -S 32kw by default, that translates to 64kb for an 8086, and 128kb for other architectures. This option is ignored on a non-executable. SEE ALSO
ln(1), cp(1), strip(1), compress(1), gzip(1), zexec(1), chown(8), chgrp(8), chmod(1), chmem(1), mkdir(1). BUGS
Uppercase K, W, and B are also accepted for those who don't know what S.I. means. AUTHOR
Kees J. Bot (kjb@cs.vu.nl) INSTALL(1)
All times are GMT -4. The time now is 05:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy