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 Mike Lewis 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. Duane61

    Aliases

    If you really wanted to have a simple alias (without having to type the "$"), you could use ... $ alias pmc='cd /inputdec/export/switch/pac/work' then,typing... $ pmc $ pwd /inputdec/export/switch/pac/work
  2. Duane61

    Significance of * at the end of filenames?

    The astrick is an indication that the file has the execute attribute set, i.e., before ls -l test => -rw-r--r-- duane61 18 Sep 3 18:52 test after chmod +x test then ls -l test => -rwxr-xr-x duane61 18 Sep 3 18:55 test* other symbols are appended when you edit a file (saves the original file...
  3. Duane61

    Help with if

    I believe you were thinking of a function. Example: #!/usr/bin/ksh #### Functions ##### Search () { echo " " echo "Enter the description that you would like to search for: " read desc if [ "$desc" ] then awk -f TNG-desc.awk workloadjobs.out | sed...
  4. Duane61

    PRINT & ECHO

    Man printf vs. man echo Using printf statements you have greater control over formatting the output.
  5. Duane61

    User Input Validation

    An easy way to trap the error and get the operator to retry is to make Dickie Bird's code (above) into a function. I say Dickie Birds because his error checking is much more rigorous! Example: #!/bin/sh #### Functions ##### SetDate { . Dickie Bird's code . } ##################### # call to...
  6. Duane61

    Determine How Long a Script Takes to Run

    Ygor: Your solution looks so tidy, but I get syntax errors when I try it, plus what if the date changes? Try this on for size...a bit more complex, but works so well! #!/bin/csh -f # display the start date and time set start_time = `date` echo 'Starting on' $start_time[1-3] 'at'...
  7. Duane61

    Just a Script to Help Out

    RSHAW: You should turn your offerring into a FAQ :-) That'll make it easier to find, when it's needed!
  8. Duane61

    Password Protect Menus..

    Depending upon your requirements and number of users, you may be able to do something similar to what I did... if [ $LOGNAME = &quot;bob&quot; ] || [$LOGNAME = &quot;dave&quot; ] then <command> else echo &quot;Not authorized&quot; fi *This is rather simplistic, but all I really needed...
  9. Duane61

    awk syntax error

    Thanks to you both... I had used finger $LOGNAME|awk '{print $7}' | head -1, but I was hoping to add a tool to the library to identify/extract various fields without having to look it up or remember it. vlad's debugging print fits that need! :-) you guys are both great - Duane
  10. Duane61

    awk syntax error

    finger $LOGNAME results in: login name: dawa In real life: David Wilson x 4223 Directory: /home/dawa Shell: /usr/bin/csh On since Jul 2 11:13:50 on pts/55 from 191.x.xxx.xx:0.0 40 seconds idle time No unread mail No plan. - - - - - - - - - - - - - The desired output is simply to...
  11. Duane61

    awk syntax error

    Okay, I bet this is easy, but can't seem to pull it out... I want to do a for loop substitution in an awk line, sorta like this: for i in 1 2 3 4 5 6 7 8 9 do user=`finger $LOGNAME | awk '{print ${@}}'` echo &quot;Hello $user&quot; done If I put a number in for {@}, I get that field, but I...
  12. Duane61

    wget concurrent execution!!!

    Maybe I'm missing something, but... how about: #!bin/sh retreiveFtpInfo & # run FTP function in the background retrieveFtpPid=$! # capture pid of last background process then, kill -9 $retrieveFtpPid # to kill the process if necessary -or- grep on...
  13. Duane61

    The (SORT -M) Command

    kind of rudimentary, but maybe your system supports: cat file1 file2 | sort | uniq -u > file3 where file3 will be the unique entries from the first two files. Duane
  14. Duane61

    grep in multiple files and different dir.

    Okay... that should have been for Folder in $FOLDERS ... Duane =/
  15. Duane61

    grep in multiple files and different dir.

    Just from a quick look...I think you need to quote the * in your cat stmnt with a backslash [.\*] to interpret correctly. As far as grep for different files and directories...depending on how many you got. You could use a FOR loop with the list of file names; for filename in filename_1...
  16. Duane61

    black screen

    Just went through this myself...last night. I am running XP Home on a 1.5 GHz Dell. The video was integral to the Motherboard. If this is the case for you (or similar) then all you have to do is go into Control Panel, Display and disable your onboard video. When you reboot all will be well...
  17. Duane61

    prepending text to multiple files

    Ed: Thanks, that was most helpful! I am going to tinker with my script using your tips & I'll post it back to see what you think. I appreciate your help, Duane
  18. Duane61

    prepending text to multiple files

    Ed: Thank you for your reply. I understand the `ticks` for execution, suppressing the terminal, & the vi commands obviously make sense, but I am at a lost with &quot;... 2>&1 <<MSG &quot; - I don't fully understand what's happening -and- &quot;MSG&quot; is a mystery to me. also, what do you...
  19. Duane61

    prepending text to multiple files

    I, too, need this ability to keep a running lab notebook. I desire that the latest entries be at the top so that the users don't have to scroll to make or read an entry. I tried the solutions mentioned here, but to no avail. I am most interested in the vi sol'n, but as written I get an illegal...

Part and Inventory Search

Back
Top