Sponsored Content
Top Forums UNIX for Dummies Questions & Answers BackUp Home/Creating User from File Post 302635589 by admin_xor on Saturday 5th of May 2012 11:42:33 AM
Old 05-05-2012
-e switch is used to define one executable block of sed. You can simply ignore this in this case; however, it's very useful when you want to process a text multiple times with different regular expression. For an example:

Code:
sed -e 's/ /\n/g' -e '/^$/d' file

This replaces spaces with new line as well as deletes any empty line in file. You could do this with help of pipe and running sed (without -e switch) two times (takes more time than the above one):

Code:
sed 's/ /\n/g' file | sed '/^$/d'

You can use the -p switch to enter encrypted password for the new user. So, if you are simply entering the password with the -p switch, it's not going to work.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Creating User Accounts from a list in file

I have a file that contains a list of names. I need a loop that creates user accounts to all the names in the list where username = names in file password = username Another question: how can i validate that a particular var is of 6 characters length I need an if statement that will... (8 Replies)
Discussion started by: Laila Saif
8 Replies

2. Solaris

Automate to backup the /home directory

Can anybody know that how to automate backup the /home directory using the own shell script especially crontab job. How to script the code in starting process of the sun sparc server in /etc/init.d/ Thank's a lot. (1 Reply)
Discussion started by: kingsan
1 Replies

3. Solaris

How to backup /home directories?

I know that how to backup the home directories in sun sparc server. Firstly, umount the filesystem, Secondly, fsck the filesystem, Thirdly, ufsdump the filesystem. Anybody know how to type the full command line backup the /home directory? (1 Reply)
Discussion started by: kingsan
1 Replies

4. UNIX for Dummies Questions & Answers

Creating tar file for subdirs, excluding one and preserving user info

Hi All, I am not one of the super users / root for AIX 5.3 system. There is a filesystem Say /DIR1 and its has several subdirs in it say SUBDIR1, SUBDIR2, SUBDIR3. Can I create a tar file for all files under DIR1 and SUBDIR1, SUBDIR3. Excluding SIBDIR2? Also how can I preserve... (2 Replies)
Discussion started by: Hangman2
2 Replies

5. Solaris

how to change /export/home/user dir to /home /user in solaris

Hi all i am using solaris 10, i am creating user with useradd -d/home/user -m -s /bin/sh user user is created with in the following path /export/home/user (auto mount) i need the user to be created like this (/home as default home directory ) useradd -d /home/user -m -s /bin/sh... (2 Replies)
Discussion started by: kalyankalyan
2 Replies

6. Shell Programming and Scripting

Need help in creating file restoration script from a backup script.

Hi all i am struggling in creating a restore of env files while doing applications clone. the first file i created for copying the important configurations file which is running perfect now for reverting the changes i mean when i am restoring these files to its original places i have to do... (7 Replies)
Discussion started by: javeedkaleem
7 Replies

7. Shell Programming and Scripting

Backup home directory

Hi Team, I want to write a script which will take a backup of my home directory. But will only backup the changes made in files not whole home directory. I want to upload that on server. I don't have any idea. please help me. (3 Replies)
Discussion started by: paragnehete
3 Replies

8. UNIX for Advanced & Expert Users

Change user while creating spool file

Hi, I have a script which generate a HTML file from a unix user. Script spool the data extracted from DB using sqlplus. Problem is html file which gets generated is automatically assigned/owned with oracle user so my unix user just having read only permission to that HTML file. So I want... (1 Reply)
Discussion started by: sv0081493
1 Replies

9. UNIX for Dummies Questions & Answers

Switching from root to normal user takes me to user's home dir

Whenever i switch from root to another user, by doing su - user, it takes me to home directory of user. This is very annoying as i want to be in same dir to run different commands as root sometimes and sometimes as normal user. How to fix this? (1 Reply)
Discussion started by: syncmaster
1 Replies
Rscript(1)								FSF								Rscript(1)

NAME
Rscript - front end for scripting with R SYNOPSIS
Rscript [--options] [-e expr] file [args] DESCRIPTION
A binary front-end to R, for use in scripting applications. expr An optional expression to be evaluated, used in place of expr. file Input file of R expressions args Optional further arguments to be processed by commandArgs in the R interpreter. OPTIONS
--options accepted are --help Print usage and exit --version Print version and exit --verbose Print information on progress --default-packages=list Where 'list' is a comma-separated set of package names, or 'NULL' and also options to R (in addition to --slave --no-restore), such as --save Do save workspace at the end of the session --no-environ Don't read the site and user environment files --no-site-file Don't read the site-wide Rprofile --no-init-file Don't read the user R profile --restore Do restore previously saved objects at startup --vanilla Combine --no-save, --no-restore, --no-site-file --no-init-file and --no-environ SEE ALSO
R(1) R scripting April 2007 Rscript(1)
All times are GMT -4. The time now is 08:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy