Timeline for Reading the contents of the file and splitting using ksh
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 11, 2013 at 18:18 | comment | added | terdon♦ | @user31522 If this answer solved your problem, please remember to mark it as accepted and/or upvote it instead of posting a thank you comment. That is the way thanks are expressed on SE sites. | |
| Feb 8, 2013 at 10:40 | comment | added | Gilles 'SO- stop being evil' | @Scott It would run cp / . since $5 and $6 are in an awk string literal and expanded (to empty strings) by the nested shell. I guess you meant system("cp \"" $5 "/" $6 "\" ."), which would break if either field contained a character that the shell expands inside double quotes ("$`). system("cp '" $5 "/" $6 "' .") is better but still break on single quotes ('). You could do source = $5 "/" $6; gsub(/'/, "'\\''", source); system("cp '" source "' /"), but it's more error-prone. By passing the names through the environment, I don't need to worry about getting the quoting right. | |
| Feb 8, 2013 at 3:21 | comment | added | Scott - Слава Україні | @Gilles: Wouldn’t system("cp \"$5/$6\" ."); be simpler (and maybe more portable)? | |
| Feb 6, 2013 at 21:44 | comment | added | user31522 | AWESOMEEEEEEEEEEEEEEEEEE great piece of work sir ... Thanks a ton!!! Thanks a tonnnnnnnnnn for the prompt response! | |
| Feb 6, 2013 at 21:37 | comment | added | Gilles 'SO- stop being evil' | @user31522 Oh, I forgot that bit. <Configuration, like the other one. It means that the command takes its input from the file Configuration. That's IO redirection. | |
| Feb 6, 2013 at 21:36 | history | edited | Gilles 'SO- stop being evil' | CC BY-SA 3.0 | added input redirection for awk |
| Feb 6, 2013 at 21:34 | comment | added | user31522 | Yeah. Thanks for the prompt response! you've put both in a wonderful way so want to get teh second one too. Do not want to miss the chance to get this. Secomd one will be more powerful true ... when it come to more processing on the data Please let me know how it is reading the file and sending it to awk ?. example: filename= Configuration | |
| Feb 6, 2013 at 21:22 | comment | added | Gilles 'SO- stop being evil' | @user31522 The two code snippets do the same thing, you use one or the other. I included both because although the first is best here, there are other fairly similar situations where the second one wins. | |
| Feb 6, 2013 at 21:20 | comment | added | user31522 | Awesome .... Great work. Thanks so much for your answer!!! The first piece work real good ... should I be using the same while loop to read the file and then pipe it to AWK ?. Thanks so much sir for the response! | |
| Feb 6, 2013 at 1:18 | history | answered | Gilles 'SO- stop being evil' | CC BY-SA 3.0 |