Have tried the search, but nothing resembles what I'd like to accomplish. I am attempting to write a script that will allow the user to input a list of data at the command prompt, then the data is used by another script for processing. I am allowing the user a list of 10 members in order to... (4 Replies)
if my user has to enter the name of months to carry out a search how can I limit the input values to only the month names and nothing else?
so far my input criteria for the user is this:
i would like it so the user can only enter the months in the way i have stated. otherwise they would... (11 Replies)
I need to write what I thought would be a fairly simple 2-line UNIX script. It can be written PERL, csh, ksh...or whatever is easiest.
The entire script will be:
Begin Scipt
source MySourceFile
execute MyExecutable.exe
End Script
The problem is that MySourceFile can not be... (1 Reply)
Hi Friends,
I am wrinting a shell script MorningChecks.sh which will call another script StartServer.sh. But the latter script requires user's inputs to complete. I want to automate this.
So can you please let me how this can be achieved?
Any help would be highly appereciated.
... (3 Replies)
I want a script that will prompt a user to enter 10 numbers and out put them into a file. This what I have so far, but isn't working. I'm guessing it's something easy I'm not seeing. Thanks for any help.
#!/usr/bin/ksh
echo "Enter 10 numbers"
for i in 1 2 3 4 5 6 7 8 9 10
do
read .... ... (8 Replies)
Hi,
Am trying to store the user inputs into a file, but the below code will store only the first line of the values. I need to store all the user input values which may contain one or more lines. Thanks in advance.
echo "please enter file names";
read name;
echo $name>/tmp/test (11 Replies)
Got struck while trying to write a shell script which should automatically give input.
While running a script for eg: (adpatch.sh)
It Prompts for Multiple inputs like:
Do you currently have files used for installing or upgrading the database
installed in this APPL_TOP ? need to give... (2 Replies)
Need a bash script that will ask the user: Which Files Would you like to copy?
Then the user would input the filenames (space seperated, all lowercase)
The script would then cp each file to /data/backup/ and also wc the files to std output. (to see how many lines each file has)
Should go... (5 Replies)
Hi,
I am new to bash scripting and i wanted to make a bash script that will generate a password for a user. The user must enter his/her name and the url of the site the password is used for. And the script will generate a password with those two elements in the password. So if the url is... (0 Replies)
Hi,
We have thousands of Video files and we need to prepare a table with few of it's parameters/values from their Mediainfo output. Here I have 3 sample mediainfo output text files named Vid1, Vid2 & Vid3 so on... (such we have thousands) and each file has exactly 3 lines.
$ ls... (6 Replies)
Discussion started by: prvnrk
6 Replies
LEARN ABOUT NETBSD
getmode
SETMODE(3) BSD Library Functions Manual SETMODE(3)NAME
getmode, setmode -- modify mode bits
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <unistd.h>
void *
setmode(const char *mode_str);
mode_t
getmode(const void *set, mode_t mode);
DESCRIPTION
The setmode() function accepts a string representation of a file mode change, compiles it to binary form, and returns an abstract representa-
tion that may be passed to getmode(). The string may be an numeric (octal) or symbolic string of the form accepted by chmod(1), and may rep-
resent either an exact mode to set or a change to make to the existing mode.
The getmode() function adjusts the file permission bits given by mode according to the compiled change representation set, and returns the
adjusted mode. While only the permission bits are altered, other parts of the file mode, particularly the type, may be examined.
Because some of the possible symbolic values are defined relative to the file creation mask, setmode() may call umask(2), temporarily chang-
ing the mask. If this occurs, the file creation mask will be restored before setmode() returns. If the calling program changes the value of
its file creation mask after calling setmode(), setmode() must be called again to recompile the mode string if getmode() is to modify future
file modes correctly.
If the mode passed to setmode() is invalid, setmode() returns NULL.
EXAMPLES
The effects of the shell command 'chmod a+x myscript.sh' can be duplicated as follows:
const char *file = "myscript.sh";
struct stat st;
mode_t newmode;
stat(file, &st);
newmode = getmode(setmode("a+x"), st.st_mode);
chmod(file, newmode);
ERRORS
The setmode() function may fail and set errno for any of the errors specified for the library routines malloc(3) or strtol(3). In addition,
setmode() will fail and set errno to:
[EINVAL] The mode argument does not represent a valid mode.
SEE ALSO chmod(1), stat(2), umask(2), malloc(3)HISTORY
The getmode() and setmode() functions first appeared in 4.4BSD.
BUGS
Each call to setmode allocates a small amount of memory that there is no correct way to free.
The type of set should really be some opaque struct type used only by these functions rather than void *.
BSD January 4, 2009 BSD