Windows to Unix? Using bash


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Windows to Unix? Using bash
# 8  
Old 12-06-2010
Code:
#!/bin/bash
while : ; do
echo "SELECT OPTION"
echo "-------------"
echo "1- Create username"
echo "2- Create password"
echo "3- Delete username"
echo "4- Exit"
read -p "enter option 1 2 3 or 4:" option
case option in
1) read -p "Enter username:"
adduser $REPLY && echo "Username successfully entered" ;;
2) passwd && "Password successfully entered" ;;
3) read -p "Enter user to be deleted: "
deluser $REPLY && echo "User deleted" ;;
4) exit ;;
*) continue ;;
esac
done

Im having trouble adding users, each time i enter a option it loops it and gives me the options again. What im i doing wrong.

Thanks

Last edited by newbie987; 12-07-2010 at 05:59 AM.. Reason: Code tags
# 9  
Old 12-06-2010
You're not doing anything wrong... it's an infinate (while :) loop.

Remove the while and closing done if you only want to do it one time.

And please start using [code]...[/code] tags. Thanks.

Last edited by Scott; 12-06-2010 at 11:43 AM.. Reason: fixed typo
This User Gave Thanks to Scott For This Post:
# 10  
Old 12-07-2010
Moderator's Comments:
Mod Comment Undeleting post by OP and closing thread.


PM from OP:

Quote:
Originally Posted by newbie987
Hey, is it possible to delete all my threads please?
Moderator's Comments:
Mod Comment No. People have spent time answering you. We don't delete threads like this. In fact, if this continues, we will revoke all user privileges to edit their own threads. You don't post in a forum, then when people answer your questions, go back and delete the original question. That is not permitted here.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Windows Batch to Bash

This line is called in a windows batch file and I need to call the same 3 jars with Parms in a bash script. cd "D:\ACDRIP\JARS" java -cp ".\RIPError.jar;.\RIP31.jar;.\RIP31msg_en_US.jar" ResubmitErrors -Ahost -P185050 pause Any ideas how to do this in Bash? (3 Replies)
Discussion started by: xgringo
3 Replies

2. Shell Programming and Scripting

Windows Task with Bash script

Hello I have a problem with use bash script in windows task. If I use script by cygwin it's working well. If I use it by Windows task I'm get error Error : ERROR 2 (HY000) at line 2: File '.\xxx.csv' not found (Errcode: 2) Code Line : load data local infile './xxx.csv' REPLACE into... (16 Replies)
Discussion started by: karp
16 Replies

3. Shell Programming and Scripting

Needed SFTP script from windows to UNIX server and from UNIX to windows server(reverse SFTP)

hi guys, i need a script to sftp the file from windows to unix server ....(before that i have to check whether the file exists in the windows server or not and again i have to reverse sftp the files from unix to windows server..... regards, Vasa Saikumar. (13 Replies)
Discussion started by: hemanthsaikumar
13 Replies

4. Shell Programming and Scripting

Using BASH on windows

So I'm looking into using BASH on this windows 7 machine. I've installed cygwin with a few optional bash installations but I don't know how to get bash to "work". I've opened the .exe and typed what few commands I understand from the tutorials I've found but some of the commands do not work. I... (10 Replies)
Discussion started by: Cambria
10 Replies

5. Shell Programming and Scripting

Unix shell script to Copy files from one Windows server to another Windows server.

Can anybody please help me on how to code for the below requirement: I need to write a shell script (on different unix server) to copy files from multiple folders (ex. BRN-000001) from one windows server (\\boldls-mwe-dev4)to a different windows server(\\rrwin-ewhd04.ecomad.int). This shell... (4 Replies)
Discussion started by: SravsJaya
4 Replies

6. Shell Programming and Scripting

Batch job in unix server to move the pdf file from unix to windows.

Hi Experts, I have a requirement where i need to setup a batch job which runs everymonth and move the pdf files from unix server to windows servers. Could some body provide the inputs for this. and also please provide the inputs on how to map the network dirve in the unix like that... (1 Reply)
Discussion started by: ger199901
1 Replies

7. AIX

Do I need to configure my local windows to FTP files from local windows to a UNIX AIX server?

Hi Friends, I have this script for ftping files from AIX server to local windows xp. #!/bin/sh HOST='localsystem.net' USER='myid_onlocal' PASSWD='mypwd_onlocal' FILE='file.txt' ##This is a file on server(AIX) ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD put $FILE... (1 Reply)
Discussion started by: rajsharma
1 Replies

8. UNIX for Dummies Questions & Answers

Changing windows server alias name on windows or unix?

My situation is that we have production unix scripts that ftp files over to a windows server. I'm not sure if its a 2000 or 2003 server as I dont work on server, more on the unix side. It turns out that they are changing servers on the network. So they are migrating our data over from say Server 1... (1 Reply)
Discussion started by: NycUnxer
1 Replies

9. UNIX for Advanced & Expert Users

missing Path(in UNIX) when i launch a job on to unix machine using windows SSh

hi i want run an unix application from a windows program/application.i am using SSH(command line version)to log on to a unix machine from windows. the application has to read a configuration file inorder to run. the configuration file .CFG is in bin in my home directory. but the application... (1 Reply)
Discussion started by: megastar
1 Replies

10. UNIX for Dummies Questions & Answers

UNIX problem? Unix programm runs windows 2000 CPU over 100%

Okee problems...!! What is happening: Unix server with some programms, workstations are windows 2000, the workstations work good but when you start a programm on the Unix server the CPU of the workstations go to 100% usage resulting that the system gets very slow. The programm well its running so... (2 Replies)
Discussion started by: zerocool
2 Replies
Login or Register to Ask a Question