My script needs to read a variable from the user. But before the user types the input, I want to give a default value so the user can edit the default value for input.
How can I implement it?
My script is something like:
#!/bin/sh
read -p 'Port number: ' -e port_number
echo "Port... (7 Replies)
I am using the while-loop to read a file.
The file has lines with null-terminated strings (words, actually.)
What I have by that reading - just a first word up to '\0'!
I need to have whole string up to 'new line' - (LF, 10#10, 16#A)
What I am doing wrong?
#make file 'grb' with... (6 Replies)
Hello, I am quite new in shell scripting and I would like to write a little scritp to run a program on some parameters files.
all my parameters files are in the same directory, so pick them up with
ls *.para >>dirafter that I have a dir file like that:
param1.para
param2.para
etc...
I... (2 Replies)
Hi All,
Am trying to write wrapper shell/bash script on a utility tool for which i need to pass 2 files as arugment to execute utility tool.
Wraper script am trying is to do with above metion 2 files.
utility tool accepts :
a. userinfo file : which contains username
b. item file : which... (2 Replies)
Heyas
I'm trying to read/display a file its content and put borders around it (tui-cat / tui-cat -t(ypwriter).
The typewriter-part is a 'bonus' but still has its own flaws, but thats for later.
So in some way, i'm trying to rewrite cat using bash and other commands.
But sadly it fails on... (2 Replies)
Hello,
I'm works on Ubuntu server
My goal : I would like to read file line per line, but i want to started at the end of file.
Currently, I use instructions :
while read line;
do
COMMAND
done < /var/log/apache2/access.log
But, the first line, i don't want this. The file is long... (5 Replies)
I have a test file with the following format, It contains the username_date when the user was locked from the database.
$ cat lockedusers.txt
TEST1_21062016
TEST2_02122015
TEST3_01032016
TEST4_01042016
I'm writing a ksh script and faced with this difficult scenario for my... (11 Replies)
Hi,
I have some 2000 names in a table like below.
Java
Oracle/SQL
ANSI SQL
SQL,DWH,DB
DB&Java
And by using for loop in my code i am able to get a single word but if there is any special character or space then it is considering as a next line.
I have to execute the below queries in... (10 Replies)
Hi,
I am attempting to assign the output of the following command, to two bash variables, var1 and var2 using "read," but it doesn't seem to be working.
# openstack hypervisor stats show | awk -F'|' 'NR==14{print $2,$3}'
vcpus 92
# echo $?
0
# openstack hypervisor... (4 Replies)
Discussion started by: sand1234
4 Replies
LEARN ABOUT CENTOS
pam_env.conf
PAM_ENV.CONF(5) Linux-PAM Manual PAM_ENV.CONF(5)NAME
pam_env.conf - the environment variables config file
DESCRIPTION
The /etc/security/pam_env.conf file specifies the environment variables to be set, unset or modified by pam_env(8). When someone logs in,
this file is read and the environment variables are set according.
Each line starts with the variable name, there are then two possible options for each variable DEFAULT and OVERRIDE. DEFAULT allows and
administrator to set the value of the variable to some default value, if none is supplied then the empty string is assumed. The OVERRIDE
option tells pam_env that it should enter in its value (overriding the default value) if there is one to use. OVERRIDE is not used, "" is
assumed and no override will be done.
VARIABLE [DEFAULT=[value]] [OVERRIDE=[value]]
(Possibly non-existent) environment variables may be used in values using the ${string} syntax and (possibly non-existent) PAM_ITEMs may be
used in values using the @{string} syntax. Both the $ and @ characters can be backslash escaped to be used as literal values values can be
delimited with "", escaped " not supported. Note that many environment variables that you would like to use may not be set by the time the
module is called. For example, HOME is used below several times, but many PAM applications don't make it available by the time you need it.
The "#" character at start of line (no space at front) can be used to mark this line as a comment line.
EXAMPLES
These are some example lines which might be specified in /etc/security/pam_env.conf.
Set the REMOTEHOST variable for any hosts that are remote, default to "localhost" rather than not being set at all
REMOTEHOST DEFAULT=localhost OVERRIDE=@{PAM_RHOST}
Set the DISPLAY variable if it seems reasonable
DISPLAY DEFAULT=${REMOTEHOST}:0.0 OVERRIDE=${DISPLAY}
Now some simple variables
PAGER DEFAULT=less
MANPAGER DEFAULT=less
LESS DEFAULT="M q e h15 z23 b80"
NNTPSERVER DEFAULT=localhost
PATH DEFAULT=${HOME}/bin:/usr/local/bin:/bin
:/usr/bin:/usr/local/bin/X11:/usr/bin/X11
Silly examples of escaped variables, just to show how they work.
DOLLAR DEFAULT=$
DOLLARDOLLAR DEFAULT= OVERRIDE=$${DOLLAR}
DOLLARPLUS DEFAULT=${REMOTEHOST}${REMOTEHOST}
ATSIGN DEFAULT="" OVERRIDE=@
SEE ALSO pam_env(8), pam.d(5), pam(8)AUTHOR
pam_env was written by Dave Kinchlea <kinch@kinch.ark.com>.
Linux-PAM Manual 09/19/2013 PAM_ENV.CONF(5)