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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by ns705

  1. ns705

    touch question

    Thank you, Denis! Yes, it is so. The problem was I had to use files, not directories. But in future I could use the technique you suggested. Thank you a lot, Anta
  2. ns705

    touch question

    Thank you, Jon. Anta
  3. ns705

    "uniqueness" question

    Thank you, Ygor. I thought about something in this line. But in this case I will should have some locking on this seqfile too. A lot of concurrent sub-process will try to read/write from it. Anta
  4. ns705

    "uniqueness" question

    Thank you, Mike. Do you think it would be more foolproof method that use srand and rand awk functions? The problem is a lot of unique values should be created during the same second in the same shell. And you will laugh but it is real matter - I have received a duplicate wia awk. Maybe I am a...
  5. ns705

    touch question

    Thank you a lot, jad. It really works. I realize I'm becoming impudent and drawing you away your work but maybe you will find a couple minutes to answer one more question please. The problem is nobody here can answer. Does this noclobber option means that all directions to all the creating...
  6. ns705

    touch question

    I'd like to ask one more question. Could you please help me with it? It works great in command line. But it does not work in script: #!/bin/ksh filel=/dir1/dir2/filelname set -o noclobber > $filelname || { echo "$filelname not created" return 8 } return 0 I can see that the file is...
  7. ns705

    "uniqueness" question

    Thank you, PHV. Yes, something about it. In my case the current shell is the same so $$ contains the same number. I hope this will help me. Thank you a lot. Anta
  8. ns705

    "uniqueness" question

    Hi, can you please help me with one question? I need to create the files with completely unique names. I attempted to use a PID of some command as this unique number, but it does not help - I faced with problem when the system uses the selected PID in some minutes for some other process... Is...
  9. ns705

    touch question

    Thank you a lot, jad! It really helps. Anta
  10. ns705

    touch question

    Hi, can you please help me with one question? I need to create a file if it does not exist. Something about: while [[ -f "$file" ]]; do sleep 1; done touch $file || echo "can not create $file" But there is a little possibility that such file is created in the time gap between while and...
  11. ns705

    substitution question

    Thank you, Ygor. I have attempted to act via sed in the same way. I have seen the need value in echo cmd, but when I tried to use this value in further commands I have no seen it - only the variable name. When I began to use some new variable: eval VARIABLEnew\=$VARIABLE and then use this new...
  12. ns705

    substitution question

    Thank you. The problem is I can see that $VARIABLE value in echo cmd, but I have a feeling that shell (ksh) does not see it in the command: newvar=`echo $var | awk ' { m=split($0,Ar,"rcd") } END { print Ar[2] }'` where $var contains $VARIABLE. It seems VARIABLE was not lost (echo outputs its...
  13. ns705

    substitution question

    I'm sorry - nothing helps. Anta
  14. ns705

    substitution question

    Thank you. The script is too large (about 40K). It includes some its parts via ". other-scripts". It contains a lot of functions. I'm very sorry - I can not post it here. Those code I mentioned is in one of the internal functions. This function is on one of lowest levels. It can run in batch...
  15. ns705

    substitution question

    Hi, can anybody help me please? I have the following code: . . . VARIABLE=sometext . . . var="abcd t1-$VARIABLE-t3 -eq 0 && xyz t1-t2-t3 -lt 8" . . . I need to have newvar="t1-sometext-t3 -eq 0 && xyz t1-t2-t3 -lt 8" I attempted to do it in the following way: newvar=`echo $var | awk ' {...

Part and Inventory Search

Back
Top