Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. LunaPan

    sort by multiple columns in file explorer?

    Hi all, is there any way to sort by more than one column in the file explorer? ie I'd like to sort by type and then date. TIA, Lunapan
  2. LunaPan

    sed/awk replacement

    *Sigh* I was making things more complicated than they needed to be as usual... thanks PH
  3. LunaPan

    sed/awk replacement

    Hi all, I'm having trouble coming up with a sed or awk to do the following... I have a text file with lines that look like: %let MYVAR = somevalue; I need to replace somevalue (alphanumeric) with the value of a shell variable. This I can do with sed -i "s#\(%let MYVAR \=...
  4. LunaPan

    BEEP!

    Thanks, that did it. What's the difference between the implementations of /usr/bin/echo (whereis echo) and /bin/echo ? Is /bin/echo just what ksh uses?
  5. LunaPan

    BEEP!

    That's not working... It needs to be in tcsh if that helps.
  6. LunaPan

    BEEP!

    Hi all, I'm trying to write an alias that will beep at the user when a program has finished running. How do I do this?
  7. LunaPan

    Determining the type of command line arguments

    for ARGUMENT in $* ; do if [ -f $ARGUMENT ] ; then echo $ARGUMENT endif done you can also use -a file true if the file exists (Korn/Bash) -b file true if the file is a block special device -c file true if the file is a character special device -d file...
  8. LunaPan

    user input in a shell script

    You're not gonna believe this... Check out vared for zsh...
  9. LunaPan

    user input in a shell script

    Whoops, I copied that wrong, it was: NEWPATH=$(rl -p "Enter your name: " -d "Bob" 2>&1 >/dev/tty) echo Hello, @${NEWPATH}@ produces... Enter your name: Bob @ello, @Bob
  10. LunaPan

    user input in a shell script

    PHV: I tried this at your suggestion and thought it worked at first, but closer inspection of the result shows it is adding a carraige return or something to the result(I tried sedding out \r's \n's and \l's with no luck) NEWPATH=$rl -p "Enter your name: " -d "Bob" 2>&1 >/dev/tty) echo Hello...
  11. LunaPan

    user input in a shell script

    FINALLY, I have exactly what I want by making a minor change to rl. I made the 3rd line from the bottom fprintf (stderr,"%s\n", temp); sending only the result to standard error. Then in the script I sent the stderr from rl to a file and used your solution for the rest. rl -p "Enter your...
  12. LunaPan

    user input in a shell script

    Almost, this gets the input into my variable, but rl still outputs the value on its own resulting in this: Enter your name: Bob Bob Hello, Bob! The problem is that the way readline is designed, all the input comes from one fd, and all the output goes to another fd, including the prompt :( The...
  13. LunaPan

    user input in a shell script

    I think I know why this is happening, the prompt is actually being fed into the variable, not the terminal... How to separate the prompt into the terminal and the typed input into my variable???
  14. LunaPan

    user input in a shell script

    Not really, the docs concentrate on readline's code, rl is an example program and doesn't really seem to be supported. (The C code for rl is has no internal documentation besides the usual GNU business...)
  15. LunaPan

    Convert Unix-Dos file to Dos file!

    Ultraedit will do this with 2 clicks of a mouse, and give you a great text editor at the same time!
  16. LunaPan

    user input in a shell script

    OK, thanks for that chipper, much easier than I expected. I've got rl working from the command prompt, but any way I try to capture the output from rl in a script, the -p prompt does not appear and none of my typed input appears until I press enter. I tried newvalue=$(rl -p "..." -d "...") as...
  17. LunaPan

    user input in a shell script

    Chipper: Although rl sounds great, I'm not sure how to go about installing a new command on an enterprise-wide system, I'm just a programmer recently getting into Unix scripting :) tput does work much better thanks, but moving the cursor to the end of the path I want to edit does not let me...
  18. LunaPan

    user input in a shell script

    Well, it seems knowitall's solution is limited afterall. You can only substitute up to 80 characters this way, and thats too few for my paths :( I thought this might have something to do with the default value of COLUMNS being 80, but when I changed it to 200, I still only got 80 characters...
  19. LunaPan

    user input in a shell script

    OK, figured it out, here's how I did it using dtksh: function vi_tab { if [[ "${.sh.edmode}" != "" && "${.sh.edchar}" == "=" ]] then .sh.edchar=`echo "$LETVALUE" | sed 's/[ \t]*$//'` fi } print "Enter a new path for this filename statement, press '=' to edit the old path:"...

Part and Inventory Search

Back
Top