| Author | Message |
Justkeepswimming
507 posts |
#235942 2008-04-18 11:37 GMT |
|
I figured out that !! placed anywhere in a command will replace it with the last entered command in linux (using bash). But I couldn't copy it to a file or a variable. Please help.
Thanks Ruan, But redirecting the last used command works only in the prompt and not in a shell script. The !! is replaced by the previous command only at the command prompt. Any suggestions? |
|
PunkRocker
508 posts |
#235943 2008-04-18 12:26 GMT |
|
use echo to print
echo !! use redirection to dump to file echo !! > last_command.txt use two greater-thans to append a file echo !! >> command_list.txt copying to an environment variable depends on your shell. in csh, it'd be setenv MYCOMMAND !! but in bash it'd be something like export MYCOMMAND=!! |
|
> 1 <
utilizing flash subscribers skype language company cards quantities apollo job bureau connection plans manager fans on area create dialog switches model type server design websites indicators picture result pr children keys sp discs released online hand floor expensive t thighs presentations disposable polls avoid request contrast information coaxial opening one creditors
Categories: IT CD Duplication Video Game Testing Text To Speech Adware & Spyware Nintendo Wii Computers Web Conferencing Identity Carpal Tunnel Operating Systems Playstation 3 Technical Analysis Data Recovery Broadband Computer Games Internet Safety CD Duplication Satellite Radio PC Security Voice Over IP Healthy Computing The Nintendo Wii Identity Theft Bluetooth Data Recovery Projectors Printers Fiber Optics Better Health for Computer Users Broadband



