1. Betriebssysteme >
  2. Linux Tipps >
  3. Retrieve variable name in a for loop


ArabicEnglishFrenchGermanGreekItalianJapaneseKoreanPersianPolishPortugueseRussianSpanishTurkishVietnamese

Retrieve variable name in a for loop

RSS Kategorie Pfeil Linux Tipps vom | Quelle: reddit.com Direktlink öffnen

Any ideas how I can retrieve the name of a variable in addition to the content sample code, expected output and actual output below:

#!/bin/bash example1="1" example2="2" example3="3" for value in $example1 $example2 $example3; do echo ${!value} value is $value done 

Desired:

example1 value is 1 example2 value is 2 example3 value is 3 

Actual:

value is 1 value is 2 value is 3 
submitted by /u/religionisanger
[link] [comments] ...

Webseite öffnen Komplette Webseite öffnen

Newsbewertung

Kommentiere zu Retrieve variable name in a for loop






Ähnliche Beiträge

  • 1. SharpSploitConsole - Console Application Designed To Interact With SharpSploit vom 269.28 Punkte ic_school_black_18dp
    Console Application designed to interact with SharpSploit released by @cobbr_ioSharpSploit is a tool written by @cobbr_io that combines many techniques/C# code from the infosec community and combines it into one sweet DLL. It's awesome so check it out!DescriptionSharpS
  • 2. How come this file isn't being detected as virus anywhere? vom 68.89 Punkte ic_school_black_18dp
    I'm pretty sure I have a virus but no antivirus is detecting it: https://www.virustotal.com/#/file/1b5e7860c517ad4c70eb750e0f0eecd43a1cf90df3adc4b5195242ef8944e9e1/detection dazhgerttcbfjuvehjnud.exe files along with dazhgerttcbfjuvehjnud.txt files created inside folders with the same name all over my thumb drives (but not inside my local d
  • 3. AzureRMR: an R interface to Azure Resource Manager vom 68.13 Punkte ic_school_black_18dp
    In a previous article I announced AzureR, a new family of packages for working with Azure from R. This article goes into more detail on how you can use AzureRMR, the base package of the AzureR family, to manage resources with Azure Resource Manager.
  • 4. Jok3R - Network And Web Pentest Framework vom 67.07 Punkte ic_school_black_18dp
    Jok3r is a Python3 CLI application which is aimed at helping penetration testers for network infrastructure and web black-box security tests.Its main goal is to save time on everything that can be automated during network/web pentest in order to enjoy more
  • 5. CloudSploit Scans - AWS Security Scanning Checks vom 65.28 Punkte ic_school_black_18dp
    CloudSploit scans is an open-source project designed to allow detection of security risks in an AWS account. These scripts are designed to run against an AWS account and return a series of potential misconfigurations and security risks. InstallationEnsure
  • 6. MMD-0037-2015 - A bad Shellshock & Linux/XOR.DDoS CNC "under the hood" vom 64.71 Punkte ic_school_black_18dp
    The background Yesterday was a hectic day when we gathered to check all recent ELF threats cross-fired in the internet traffic when I was informed of a recent shellshock attack. Seeing the command pattern of the one-liner shell executed script used I knew
  • 7. MMD-0037-2015 - A bad Shellshock & Linux/XOR.DDoS CNC "under the hood" vom 64.71 Punkte ic_school_black_18dp
    The background Yesterday was a hectic day when we gathered to check all recent ELF threats cross-fired in the internet traffic when I was informed of a recent shellshock attack. Seeing the command pattern of the one-liner shell executed script used I knew
  • 8. MMD-0037-2015 - A bad Shellshock & Linux/XOR.DDoS CNC "under the hood" vom 64.71 Punkte ic_school_black_18dp
    The background Yesterday was a hectic day when we gathered to check all recent ELF threats cross-fired in the internet traffic when I was informed of a recent shellshock attack. Seeing the command pattern of the one-liner shell executed script used I knew
  • 9. MMD-0037-2015 - A bad Shellshock & Linux/XOR.DDoS CNC "under the hood" vom 64.71 Punkte ic_school_black_18dp
    The background Yesterday was a hectic day when we gathered to check all recent ELF threats cross-fired in the internet traffic when I was informed of a recent shellshock attack. Seeing the command pattern of the one-liner shell executed script used I knew
  • 10. MMD-0037-2015 - A bad Shellshock & Linux/XOR.DDoS CNC "under the hood" vom 64.71 Punkte ic_school_black_18dp
    The background Yesterday was a hectic day when we gathered to check all recent ELF threats cross-fired in the internet traffic when I was informed of a recent shellshock attack. Seeing the command pattern of the one-liner shell executed script used I knew
  • 11. MMD-0037-2015 - A bad Shellshock & Linux/XOR.DDoS CNC "under the hood" vom 64.71 Punkte ic_school_black_18dp
    The background Yesterday was a hectic day when we gathered to check all recent ELF threats cross-fired in the internet traffic when I was informed of a recent shellshock attack. Seeing the command pattern of the one-liner shell executed script used I knew
  • 12. MMD-0037-2015 - A bad Shellshock & Linux/XOR.DDoS CNC "under the hood" vom 64.71 Punkte ic_school_black_18dp
    The background Yesterday was a hectic day when we gathered to check all recent ELF threats cross-fired in the internet traffic when I was informed of a recent shellshock attack. Seeing the command pattern of the one-liner shell executed script used I knew