Sponsored Content
Top Forums Shell Programming and Scripting Expansion not working properly Post 302956410 by RudiC on Tuesday 29th of September 2015 03:31:12 PM
Old 09-29-2015
You mean shell's "parameter and variable expansion"? Are you sure USER is defined? What's the result of echo $USER?

You know you don't need grep if awk is around?
 

10 More Discussions You Might Find Interesting

1. Programming

y is this not working properly?

#include <stdio.h> #include <sys/types.h> #include <string.h> #include <sys/stat.h> #include <unistd.h> struct stat s; main() { char c; if (fork()==0) { system("clear"); do { printf("myAI\\>§ "); scanf("%s",c); if(stat(c,&s)>-1) {... (3 Replies)
Discussion started by: C|[anti-trust]
3 Replies

2. Shell Programming and Scripting

Basic variable expansion not working...

#!/usr/bin/bash if then echo "Not valid arguments entered. Just username should be entered." else USER_NAME=$1 FILE_NAME=$USER_NAME.info UNN=STUDIN\\\\$1 echo $UNN last STUDIN\\\\$1 last UNN If I type `last STUDIN\\eip060` it works but if I try to expand it with variable it is... (5 Replies)
Discussion started by: Zammy_bg
5 Replies

3. UNIX for Dummies Questions & Answers

Telnet is not working properly

telnet at my system is behaving stange. Some times I am able to telnet to other machines but sometimes it stop doing that. Then i have to reboot the machine and most of the time (not 100%) it works. SImilar is the case with SSH. Sometime it works , some time it don't. i am new to Unix and I do not... (1 Reply)
Discussion started by: deepak_pathania
1 Replies

4. Shell Programming and Scripting

\n not working properly

Hi all, I'm trying to generate a series of txt files starting from a plain csv file part of my code: #!/bin/ksh INSTALLDIR=/Users/ME/Installdir CSV=CSV.csv TMP=/tmp/$(basename $0).txt tr -s "\r" "\n" < /$INSTALLDIR/$CSV > $TMP function Makefiles { printf '%24s:%30s\n' "sometext"... (1 Reply)
Discussion started by: Jive Spector
1 Replies

5. UNIX for Advanced & Expert Users

Sendmail is not working properly

Hi All, Can any one help me to solve the issue. The Issue is, i have started the sendmail service on my RHEL 4 update 6 box, I am able to send the mail from my box to almost all of the Email Id's except few. Exampe, test mail. . Output is :the message is sent. now if I send the... (2 Replies)
Discussion started by: akhtar.bhat
2 Replies

6. Red Hat

sudo is not working properly

This is the first time for using sudo for me. # visudo ## Allows people in group admin to run all commands %admin ALL=(ALL) ALL # groupadd admin # useradd temp # usermod -a -G admin temp # id temp uid=506(temp) gid=506(temp) groups=506(temp),507(admin) # #sudo... (5 Replies)
Discussion started by: getrue
5 Replies

7. Shell Programming and Scripting

uuencode is not working properly

Hello Everyone, I'm very new to the shell script. I'm trying to send multiple attachments in unix using uuencode command. Total I have 3 text files which should be send in mail. but I'm getting 6 files and 3 files with subject as file name. And the content is ` end I'm working... (6 Replies)
Discussion started by: narikivar
6 Replies

8. Shell Programming and Scripting

Parameter expansion not working for all strings...

I'm trying to write a script that parses my music collection and hard link some filenames that my media player doesn't like to other names. To do this I need to extract the name and remove alla non ASCII characters from that and do a cp -l with the result. Problem is this: 22:16:58 $... (8 Replies)
Discussion started by: refuser
8 Replies

9. Shell Programming and Scripting

Why is sort not working properly here ?

Platform: RHEL 5.4 In the below text file I have strings like following. $ cat /tmp/mytextfile.txt DISK1 DISK10 DISK101 DISK102 DISK103 DISK104 DISK105 DISK106 DISK107 DISK108 DISK109 DISK110 DISK111 DISK112 DISK113 DISK114 (8 Replies)
Discussion started by: kraljic
8 Replies

10. Shell Programming and Scripting

Join not working properly

I want to join two files , with file 1 col 3 and file 2 col 1 as key. The join command is erratic for some reason. File 2 is a master file having all the names, and file 1 has some values. I want to add the names from fil2 in file 1. If I use the original master file, some output is missing. ... (16 Replies)
Discussion started by: ritakadm
16 Replies
CREATE 
USER(7) SQL Commands CREATE USER(7) NAME
CREATE USER - define a new database user account SYNOPSIS
CREATE USER username [ [ WITH ] option [ ... ] ] where option can be: SYSID uid | [ ENCRYPTED | UNENCRYPTED ] PASSWORD 'password' | CREATEDB | NOCREATEDB | CREATEUSER | NOCREATEUSER | IN GROUP groupname [, ...] | VALID UNTIL 'abstime' DESCRIPTION
CREATE USER will add a new user to an instance of PostgreSQL. Refer to the Administrator's Guide for information about managing users and authentication. You must be a database superuser to use this command. PARAMETERS username The name of the user. uid The SYSID clause can be used to choose the PostgreSQL user ID of the user that is being created. It is not at all necessary that those match the Unix user IDs, but some people choose to keep the numbers the same. If this is not specified, the highest assigned user ID plus one (with a minimum of 100) will be used as default. password Sets the user's password. If you do not plan to use password authentication you can omit this option, but the user won't be able to connect to a password-authenticated server. The password can be set or changed later, using ALTER USER [alter_user(7)]. ENCRYPTED UNENCRYPTED These keywords control whether the password is stored encrypted in pg_shadow. (If neither is specified, the default behavior is determined by the PASSWORD_ENCRYPTION server parameter.) If the presented string is already in MD5-encrypted format, then it is stored as-is, regardless of whether ENCRYPTED or UNENCRYPTED is specified. This allows reloading of encrypted passwords during dump/restore. See the chapter on client authentication in the Administrator's Guide for details on how to set up authentication mechanisms. Note that older clients may lack support for the MD5 authentication mechanism that is needed to work with passwords that are stored encrypted. CREATEDB NOCREATEDB These clauses define a user's ability to create databases. If CREATEDB is specified, the user being defined will be allowed to cre- ate his own databases. Using NOCREATEDB will deny a user the ability to create databases. If this clause is omitted, NOCREATEDB is used by default. CREATEUSER NOCREATEUSER These clauses determine whether a user will be permitted to create new users himself. This option will also make the user a supe- ruser who can override all access restrictions. Omitting this clause will set the user's value of this attribute to be NOCREA- TEUSER. groupname A name of a group into which to insert the user as a new member. Multiple group names may be listed. abstime The VALID UNTIL clause sets an absolute time after which the user's password is no longer valid. If this clause is omitted the login will be valid for all time. DIAGNOSTICS
CREATE USER Message returned if the command completes successfully. NOTES
Use ALTER USER [alter_user(7)] to change the attributes of a user, and DROP USER [drop_user(7)] to remove a user. Use ALTER GROUP [alter_group(l)] to add the user to groups or remove the user from groups. PostgreSQL includes a program createuser [createuser(1)] that has the same functionality as this command (in fact, it calls this command) but can be run from the command shell. EXAMPLES
Create a user with no password: CREATE USER jonathan; Create a user with a password: CREATE USER davide WITH PASSWORD 'jw8s0F4'; Create a user with a password, whose account is valid until the end of 2001. Note that after one second has ticked in 2002, the account is not valid: CREATE USER miriam WITH PASSWORD 'jw8s0F4' VALID UNTIL 'Jan 1 2002'; Create an account where the user can create databases: CREATE USER manuel WITH PASSWORD 'jw8s0F4' CREATEDB; COMPATIBILITY
The CREATE USER statement is a PostgreSQL extension. The SQL standard leaves the definition of users to the implementation. SEE ALSO
ALTER USER [alter_user(7)], DROP USER [drop_user(l)], createuser(1) SQL - Language Statements 2002-11-22 CREATE USER(7)
All times are GMT -4. The time now is 02:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy