Timeline for Declaring a variable that does not have input
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 11, 2017 at 23:17 | history | edited | poisonjam | CC BY-SA 3.0 |
added 73 characters in body
|
| Dec 11, 2017 at 23:02 | history | edited | poisonjam | CC BY-SA 3.0 |
added 175 characters in body
|
| Dec 3, 2017 at 23:31 | comment | added | AlexP |
grep '^\string' looks for lines which begin with one whitespace character followed by the letters t r i n g. This regexp will never match substring AA. I cannot fully understand what is it that you are asking, but you seem to want to find the second field separated by whitespace, or the null string is no such field exists; sed -e 's/$/ /' | cut -d' ' -f2 will do the trick. (The sed appends a space character, thus making sure that cut is satisfied.)
|
|
| Dec 3, 2017 at 23:25 | answer | added | tluafed | timeline score: 0 | |
| Dec 3, 2017 at 22:18 | history | edited | poisonjam | CC BY-SA 3.0 |
added 358 characters in body
|
| S Dec 3, 2017 at 19:58 | history | edited | Stephen Rauch | CC BY-SA 3.0 |
Grammar in title
|
| S Dec 3, 2017 at 19:58 | history | suggested | Brethlosze | CC BY-SA 3.0 |
Grammar in title
|
| Dec 3, 2017 at 19:52 | review | Suggested edits | |||
| S Dec 3, 2017 at 19:58 | |||||
| Dec 3, 2017 at 18:08 | comment | added | ilkkachu |
What does the .sh_history file contain? Do you need to run strings on it? You're also doing tail -1 on it, so there's not much to loop over, if looping over the output of that function is what you mean. Can you edit the question to contain some example of the input file contents? And please take a peek at the editing help, the part about code block formatting.
|
|
| Dec 3, 2017 at 16:57 | history | asked | poisonjam | CC BY-SA 3.0 |