IT Questions and Answers :)

Tuesday, June 12, 2018

In a Windows command script (cmd.exe), what does the string %~dp0 stand for?

In a Windows command script (cmd.exe), what does the string %~dp0 stand for?

  • The script's current working directory
  • The path, including drive, where the script resides
  • The user's home directory
  • The system's temp directory 

EXPLANATION


In the help for the FOR command, the %~ format for variable expansion is discussed.  This can be used outside of the FOR command as well.  The following options are relevant:
%~dI - expands %I to a drive letter only
%~pI - expands %I to a path only
The modifiers can be combined to get compound results, so
%~dp0 - expands %I to a drive letter and path only
Finally, %0 is the built-in variable reference to the path to the batch file that includes the file name (i.e. the 0th argument to the cmd.exe program).
The script's current working directory is returned using cd with no arguments.  It isn't necessarily the same as the script's parent directory, especially if the script is run from a non-system drive or UNC path.  In the latter case, the working directory can end up being set to the Windows directory.
The user's home directory is referenced by the "%HOMEDRIVE%\%HOMEPATH%" or %USERPROFILE% envars.
The system temp directory is referenced by the %TEMP% envar.

SOURCE

http://stackoverflow.com/questions/5034076/what-does-dp0-mean-and-how-does-it-work
Share:

Saturday, June 9, 2018

Which BASH internal variable holds the exit status of the previous command or function?

Which BASH internal variable holds the exit status of the previous command or function?

  • $?
  • $_
  • $@
  • $$ 

 
Which BASH internal variable holds the exit status of the previous command or function?

EXPLANATION

$? is a special variable that is internal to the BASH interpreter. It is used to hold the exit code of the previously executed command or function (or even the script itself).

Example:

#!/bin/bash

/bin/true
echo $? #prints 0

/bin/false
echo $? #prints 1

/bin/foobar
res=$?
if [ $res -ne 0 ]
then
  echo "Command foobar failed to execute or exited with a non-zero status: $res"
else
   echo "Command foobar exited successfully"
fi

Share:

Thursday, June 7, 2018

The intersection of a column and row in a spreadsheet is called a bon or a __?

The intersection of a column and row in a spreadsheet is called a bon or a __?

  • Cell
  • Box
  • Key
  • Field 
The intersection of a column and row in a spreadsheet is called a bon or a __?

 

EXPLANATION





The intersection of a vertical column and horizontal row is called a cell.The location, or address, of a specific cell is identified by using the headers of the column and row involved. For example, cell "F2" is located at the spot where column "F" and row "2" meet.

Share:

Wednesday, June 6, 2018

Which type of malicious attack not only affects the bandwidth of your connection but also interferes with your mailbox's capability to handle normal email?

Which type of malicious attack not only affects the bandwidth of your connection but also interferes with your mailbox's capability to handle normal email?

  • TCP Syn Scan
  • Mail bombing
  • Spam
  • Flood pings 

 
Which type of malicious attack not only affects the bandwidth of your connection but also interferes with your mailbox's capability to handle normal email?

EXPLANATION




 A mail bomb attack sends massive amounts of email to a specific person or system.
A huge amount of mail may simply fill up the recipient's disk space on the server or, in some cases, may be too much for a server to handle and cause the server to stop functioning.

Share:

Tuesday, June 5, 2018

If you have a RAID 10 setup with four 500 GB HDDs, how much usable storage capacity will you have?

If you have a RAID 10 setup with four 500 GB HDDs, how much usable storage capacity will you have?

  • 1 TB
  • 4 TB
  • 2 TB
  • 1.5 TB 
If you have a RAID 10 setup with four 500 GB HDDs, how much usable storage capacity will you have?

 EXPLANATION

RAID 10 contains two sets of mirrored drives, and each mirrored set takes two 500 GB drives to store 500 GB of data.
The data will be striped across the two sets for a total of 1 TB usable storage.
Share:

Popular Posts