LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-25-2014, 10:21 AM   #1
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 231

Rep: Reputation: 5
Prompt question


I would like to create a .bashrc string that would place a string after the next prompt and hold, not executing the instruction.

Example:

Type in abc at the prompt and hit enter:
root@host~# abc

The next prompt would be as follows, holding without executing the 'ls -a':

root@host~# ls -a
 
Old 05-25-2014, 10:58 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,256

Rep: Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686
Why? And how would abc translate to this command? Is this an alias which you wanted to see what it was equal to prior to executing the command?

As you can see, there would seem to be more questions to this than answers ... at least initially.
 
Old 05-25-2014, 11:08 AM   #3
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 231

Original Poster
Rep: Reputation: 5
All I want to do is put a string at the end of the prompt and not have it execute. That way I can make a modification to the string before hitting enter and executing it.
 
Old 05-25-2014, 11:12 AM   #4
ndc85430
Member
 
Registered: Apr 2014
Distribution: Slackware
Posts: 92

Rep: Reputation: Disabled
How complicated are the commands you're going to use this for? If "ls -a" is as complicated as it gets, what's wrong with just typing it? It would help to show us more real examples of what you want to do. Perhaps a wrapper script around whatever it is you want to run would suffice - that way you could parameterise, say, the arguments.
 
Old 05-25-2014, 11:25 AM   #5
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 231

Original Poster
Rep: Reputation: 5
Well, of course it is more complicated that that, although if someone wanted to have 'ls -' at the prompt so that they could put in the parameters would seem to be legitimate. I am not real good yet with writing scripts, but I give that avenue a try.
Thanks.
 
Old 05-25-2014, 11:36 AM   #6
ndc85430
Member
 
Registered: Apr 2014
Distribution: Slackware
Posts: 92

Rep: Reputation: Disabled
If you're using Bash, you may also want to look at using Ctrl-R to search through the history. See, e.g. this. Other shells probably have a similar feature.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] bash prompt question sharky Linux - Newbie 2 05-28-2010 12:49 PM
login prompt question & kde scheme question JustinCoyan Slackware 2 06-09-2004 03:02 PM
prompt question, this is very noob dexter_modem Linux - Newbie 1 11-13-2003 11:06 AM
Question about bash prompt sangjin Linux - Newbie 2 07-30-2003 03:08 AM
Bash Prompt Question ghight *BSD 6 01-31-2003 01:30 PM


All times are GMT -5. The time now is 08:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration