The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
NIM Questions tb0ne AIX 5 08-16-2007 07:23 AM
Few questions gina Shell Programming and Scripting 2 05-28-2007 05:47 AM
A few questions... halluc1nati0n UNIX for Dummies Questions & Answers 2 03-28-2007 10:29 AM
3 questions in 1 alikun UNIX for Dummies Questions & Answers 2 03-27-2007 02:59 AM
ftp questions lewisoco UNIX for Advanced & Expert Users 5 10-27-2005 05:45 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-05-2004
Blip Blip is offline
Registered User
  
 

Join Date: Jan 2004
Posts: 27
some questions...

hello. I'm fairly new to unix and have a few script writing questions for any experienced users. However, my computer is a mac so I need commands that will run in a macosx terminal.
ok:
q1) im writing a script where I want to get the history in the terminal and then write it to a specific text file. I'm not sure how to do it. I tried:
history | touch /dir/dir/dir/etc/filename

can anyone tell me why it didnt work/what would be the right command/commands.

q2)Im writing another script and I want the terminal to prompt the user for their password. I dont know how to collect user input or prompt them. Is it possible? All i can do is: echo 'password:'

but thats not an input prompt and the [ownername] command ready thing is just gonna pop back up once the script is done executing and they wont enter a password near my input prompt. how do i actually make a input/prompt thing?

q3)i have yet another script (lets call it script.sh). I want script.sh to execute when a user clicks on it rahter than them having to execute it with the ./ command in the terminal. How?


Well those are my questions. Hopefully someone can answer them. Thanks alot.
  #2 (permalink)  
Old 01-05-2004
cbkihong cbkihong is offline Forum Advisor  
Advisor
  
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,624
For 3), you may put your script in /usr/local/bin. Then, if /usr/local/bin is in your PATH, then you can invoke it without ./
  #3 (permalink)  
Old 01-05-2004
Blip Blip is offline
Registered User
  
 

Join Date: Jan 2004
Posts: 27
Ok, but I want the script to open from the desktop just by double clicking it. Is there a way to have a script execute from anywhere by just double clicking the file?How can I do that instead of putting it off in the usr/local/bin folder?
  #4 (permalink)  
Old 01-05-2004
cbkihong cbkihong is offline Forum Advisor  
Advisor
  
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,624
Sorry I misread that. Then that's an issue with your GUI used. I use KDE, but I believe GNOME also has a similar function that lets you create a "shortcut" on the desktop just as you do on Windows. Just right click on your desktop and you ought to find an option like create a new link.
  #5 (permalink)  
Old 01-05-2004
Blip Blip is offline
Registered User
  
 

Join Date: Jan 2004
Posts: 27
I think I may be doing something wrong, but I tried what you suggested. I control-clicked(i have a mac, no right clicks) on the desktop and it brought up the options: Help, New Folder, Get info, and Change Desktop Background. Then I control-clicked on the file i want to execute in the terminal via the desktop(test.sh) and it brought up the options: Help, Open, Open With, Get Info, Move To Trash, Make Alias, Duplicate, and Copy "Test.sh". I tried to change Open With to open with the terminal but it wouldnt let me. I think I'm doing something wrong.
  #6 (permalink)  
Old 01-05-2004
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
I don't know your environment, but I'll make a few guesses based on what I know.

touch does not read stuff from standard in. So piping stuff to it does nothing. Try: history > /dir/file

And "echo -n prompt " might work. Or "echo 'prompt \c'.
  #7 (permalink)  
Old 01-06-2004
cbkihong cbkihong is offline Forum Advisor  
Advisor
  
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,624
I guess you use GNOME. I don't know mac, but you ought to find a "New Launcher" menu item which allows you to create a shortcut, in M$ terminology.

http://www.gnome.org/learn/users-gui...eskback-9.html
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:05 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0