Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

8
LINES

< > BotCompany Repo | #1032382 // safePlatformQuote - quote stuff for platform-specific command line. use single quotes on Linux so no $ variables are interpreted

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (99L/1K).

// TODO: what to do on Windows?
sS safePlatformQuote(S s) {
  ret isWindows() ? winQuote(s) : safeBashQuote(s);
}

sS safePlatformQuote(File f) {
  ret safePlatformQuote(f2s(f));
}

Author comment

Began life as a copy of #1016316

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032382
Snippet name: safePlatformQuote - quote stuff for platform-specific command line. use single quotes on Linux so no $ variables are interpreted
Eternal ID of this version: #1032382/1
Text MD5: b88685abb4fb453852af4550381c2e75
Transpilation MD5: 72422b51e71a31f352cc0ee4f21e74c1
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-02 02:57:47
Source code size: 187 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 75 / 122
Referenced in: [show references]