Skip to main content

IT - cygwin - Call DOS command

To execute a MS-DOS command from inside a cygwin BASH script:

  • use <<<
  • surround the entire command with quotes
  • any quotes inside the command has to be escaped (\")
  • any folder divider has to be escaped (\\)
  • mklink can only be used if the cygwin terminal is executed as Administrator

$ cmd <<< "mklink /D \"${cn:1:4}_${r//\\/_}\" \"F:\\TV\\all\\$(echo "${REPLY}")\""
  • using & allows to execute more than one MS-DOS command
$ cmd <<< "dir & dir" 

Comments

Popular posts from this blog

IT - My Home Platform View - All Infrastructure

Some ideas Deploy a harverster cluster Deploy a rancher server

Movie - The Gray Man (2022)

  My views Plot In 2003, senior  CIA  official Donald Fitzroy visits a prisoner named Courtland Gentry in Florida. Eight years earlier, Courtland was a minor convicted of killing his abusive father to protect his brother. Fitzroy offers him his freedom in exchange for working as an assassin in the CIA's  Sierra  program, an elite black ops unit, which will allow him to exist in the gray. In 2021, Courtland, now known as  Sierra Six , is working with fellow CIA agent Dani Miranda to assassinate a target named Dining Car suspected of selling off  national security  secrets in  Bangkok  during the national  Songkran  festival. Unable to do so stealthily without harming civilians, he attacks Dining Car directly, mortally wounding him. Before dying, he reveals he was also in the Sierra program as Sierra Four. He hands Six an encrypted drive detailing the corruption of CIA official Denny Carmichael, the lead agent on the assassinatio...

Movie - Source Code (2011)

  My views Romantic movie wrapped around a SciFi movie A Helicoper Captain with the intelligence of a pea Going back all the time, with 8 minutes, and wasting time talking about feelings... Plot U.S. Army pilot Captain Colter Stevens wakes up on a  Metra [ 6 ]  commuter train going into Chicago. He is disoriented, as his last memory was of flying a mission in Afghanistan. However, to the world around him – including his friend Christina Warren and his reflection in the train's windows and mirrors – he appears to be a different man: a school teacher named Sean Fentress. As he expresses his confusion to Christina, the train explodes while passing another train, killing everyone aboard. Stevens abruptly awakens in a dimly lit cockpit. Communicating through a video screen, Air Force Captain Colleen Goodwin verifies Stevens's identity and tells him of his mission to find the train bomber before sending him back to the moment he awoke on the train. Believing he is being tested ...