Hot answers tagged scripting
hostname $(blkid | perl -lne '/LABEL="(.*?)".*vfat/ and print $1') or hostname $(blkid | perl -lne '/sda1.*LABEL="(.*?)"/ and print $1') Since you don't have Perl, your grep may not have -P. if it does, try hostname $(blkid | grep -Po 'LABEL="\K.*?(?=".*vfat)') or hostname $(blkid | grep -Po 'sda1: LABEL="\K.*?(?=".*)') For a pure Bash version: ...
XP (Lan Wired) Here, NetConnectionStatus=2 grabs the active (connected) network interface and 'more +1' skips the header line: C:\>wmic.exe nic where "NetConnectionStatus=2" get PNPDeviceID |more +1 PCI\VEN_10EC&DEV_8139&SUBSYS_813910EC&REV_10\4&1F7DBC9F&1&30F0 Then feeding the string (up to the first ampersand for short) to ...
You have to URL encode the special characters (weird characters) on a Mac, because "mount_smbfs: -o user: option not supported". So, in your example, '^' = %5E URL Encoding here: http://www.w3schools.com/tags/ref_urlencode.asp
Only top voted, non community-wiki answers of a minimum length are eligible