BASH or applescript keygen


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers BASH or applescript keygen
# 1  
Old 03-12-2009
BASH or applescript keygen

Please help me to make this script to create a key based on these parameters:

the output of $USER is smithm for mike smith
the output of id smithm is uid=1042(smithm) gid=20(staff) groups=20(staff), 1025(group1), 1057(group2), 1028(group5), 1038(group3), 1037(group4)

I need a script that puts last letter, first letter of username (ms)
then puts uid (1042)
then appends 09 to the end of each user

so for mike smith is would be: ms104209

I need a script that would do this for any user who runs it.

please help, thanks!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

Delete or move post to applescript area

i posted an applescript question in the wrong area, trying frantically to delete or move before I get in trouble for posting question in wrong area. it is the one about opening webpages and searching text with applescript, thanks (1 Reply)
Discussion started by: ilovedoritos
1 Replies

2. OS X (Apple)

Applescript application call problem...

Hi all... I am trying to create a shell project purely for this Macbook Pro. I do NOT want to use SOX as the sampling _source_ but Quicktime instead, the idea being that NO third party installs will be needed. The code below works fine except the commented out Applescript line does not do... (2 Replies)
Discussion started by: wisecracker
2 Replies

3. Shell Programming and Scripting

SED command works in terminal, but not Applescript

The following command works perfectly in Terminal, but not in Applescript. (Returns "unknown token" error for square brackets.) (new to site. sorry.) I have an Applescript that is designed to find and remove any square-bracketed text, including the square brackets. I ran the following code from... (1 Reply)
Discussion started by: Phillip Acosta
1 Replies

4. Shell Programming and Scripting

applescript & grep - sed command

I'm new using Unix commands in applescript. The following script you choose different folders with PDfs, get file count of PDfs on chosen folders, & write the results in text file. set target_folder to choose folder with prompt "Choose target folders containing only PDFs to count files" with... (0 Replies)
Discussion started by: nellbern
0 Replies

5. OS X (Apple)

[Solved] Running shell code in AppleScript without Terminal

What I want my script to do is to run a command in Terminal and close that same Terminal window when the process is complete. Of course I could ad a delay of 6 seconds to complete the process, but it may not be enough every time. To simplify my question, this is what I want to achieve.... (9 Replies)
Discussion started by: ShadowofLight
9 Replies

6. Shell Programming and Scripting

Scripting in AppleScript

What I want my script to do is to run a command in Terminal and close that same Terminal window when the process is complete. Of course I could ad a delay of 6 seconds to complete the process, but it may not be enough every time. To simplify my question, this is what I want to achieve.... (0 Replies)
Discussion started by: ShadowofLight
0 Replies

7. OS X (Apple)

Need help writing an Applescript to launch a specific Terminal Command...

I developed a script in Lingon (which is an automated script editor developed for OS X) that is used to automatically restart programs only if they crash. The script itself does just that, but I only want it to load if I'm going to use the specific application that it's designed to protect. In the... (2 Replies)
Discussion started by: JFraser1
2 Replies

8. Shell Programming and Scripting

Need help writing an Applescript to launch a specific Terminal Command...

I developed a script in Lingon (which is an automated script editor developed for OS X) that is used to automatically restart programs only if they crash. The script itself does just that, but I only want it to load if I'm going to use the specific application that it's designed to protect. In... (3 Replies)
Discussion started by: JFraser1
3 Replies

9. OS X (Apple)

AppleScript to Bash

Any ideas on converting an applescript into bash? Simple method to get rid of delimiters? (9 Replies)
Discussion started by: unimachead
9 Replies

10. Shell Programming and Scripting

Terminal vs. Applescript

I am running Mac OS X (10.5). I run the following script successfully in terminal in order to split an mp3 file into 3 smaller mp3 files... split -b 8667k -a1 Monday.mp3 Levin-Hour_; ls Lev* | sed "s/.*/mv '&' '&.mp3'/g" | zsh However, when I run a similar script within the Applescript editor... (2 Replies)
Discussion started by: tgaleza
2 Replies
Login or Register to Ask a Question
id(1)							      General Commands Manual							     id(1)

NAME
id - Displays the user's system identity SYNOPSIS
id [user] id -G [-n] [user] id -g [-nr] [user] id -u [-nr] [user] id -a STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: id: XCU5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. OPTIONS
Displays all groups ids (real, effective, and supplementary) only, as unsigned decimal numbers. Displays only the effective group id as an unsigned decimal number. Displays user and group names as strings rather than as numbers. Displays only the real ID. Displays only the effective user ID as an unsigned decimal number. [Tru64 UNIX] Displays user and all group IDs and names if the environment variable CMD_ENV is set to the string svr4. OPERANDS
The user for whom information is to be written. If this parameter is omitted, the user and group names associated with the invoking process are used. DESCRIPTION
The id command writes to standard output a message containing the user and group IDs and corresponding names of the invoking process. If effective names and IDs do not match the real ones, the id command writes both. If user is specified and the invoking process has sufficient privileges, the IDs and names in the message are for user rather than for the invoking process. Effective IDs are assumed identical to real IDs. Your real user and group ids are specified in the /etc/passwd file and are your user and group ids on login. You can change your active group with the newgrp shell command (see newgrp(1)) if additional groups are specified for you in the /etc/group file. Such groups are called supplementary . A process can also have an effective user or group id set when a set-user- or set-group-identifier program is executed. See setuid(2), setgid(2). SVID Conformance [Tru64 UNIX] When the environment variable CMD_ENV is set to the string svr4, the command syntax and output is compatible with the SVID standard. In particular, the id command with no options displays the user's name and id and the real and effective group names and ids. The -a option adds any supplementary group names and ids to the display. EXIT STATUS
The following exit values are returned: Successful completion. An error occurred. EXAMPLES
To display your user and group IDs, enter: id Information is displayed similar to: uid=200(thomas) gid=1(staff) In the case where a user belongs to a supplementary group, information is displayed similar to: uid=200(thomas) gid=1(staff) groups=0(system) However, if the environment variable CMD_ENV is set to the string svr4, the command id with no options does not display any supple- mentary groups and results in a display similar to: uid=200(thomas) gid=1(staff) To display supplementary groups with CMD_ENV set to svr4, use the command id -a. The display is then similar to: uid=200(thomas) gid=1(staff) groups=1(users),0(system) ENVIRONMENT VARIABLES
The following environment variables affect the execution of id: [Tru64 UNIX] When this environment variable CMD_ENV is set to the string svr4, the command syntax and output is compatible with the SVID standard. The -a option is only available in this condition. Provides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization variables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value, overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). Determines the locale for the format and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of LC_MESSAGES. FILES
Group names declared on the system. Password file. SEE ALSO
Commands: groups(1), logname(1), newgrp(1), who(1) Functions: getgid(2), getuid(2), setgid(2), setuid(2) Files: group(4), passwd(4) Environment: environ(5) Standards: standards(5) id(1)