Tag Info

Hot answers tagged

3

Windows CMD.EXE does not have a built in facility to work with special characters like linefeed or carriage return. But there are known hacks that can give you access to a few frequently needed characters. CarriageReturn (CR) 0x0D All that is needed is a file - any file. Preferably the file should be small so that the command runs faster. The contents of ...


2

I finally found it, to input the special character '^]', and i insist on the fact that it is ONE character, on a linux ubuntu (may work on other distrib, does not work on windows) you have to press AltGR+Ctrl+] ] is on the key with those 3 characters : °)]. It will not work at all time, i know it works in telnet but on the terminal it print nothing.


2

The output of iwconfig puts the name of the access point in double quotes, which leads to some weirdness. The author of the script deals with this "artifact" in his script rather than getting rid of it right away. I suggest to remove the quotes before doing anything else. Two possible approaches would be: $ eval moo=`iwconfig wlan0 | awk -F":" ...


2

Don't mess with re-quoting, it won't work due to the way sh/bash use word-splitting on variables -- that is, they split the value without first considering the quotes in the value. You could get around that by using eval "$path/aapt-orig $params"... But Bash has arrays, use them instead: #!/usr/bin/env bash args=() args+=("$1"); shift ...


1

This should work with more shells, and may be easier to understand: #!/bin/sh first="$1"; shift; exec "`dirname '$0'`/aapt-orig" "$first" --custom-package com.foo.bar "$@"; Note that it works because shells treat "$@" specially, see section "Special Parameters" in the Bash manpage.


1

Don't try to add literal quotes. You need if [ "$LIST" = "$1" ]; .... Both variables need to be quoted so the test command is given exactly 3 arguments -- this is crucial particular because the values contain spaces. Same advice for the second: if [ -z $(iwlist wlan0 scan | grep -m 1 -o "$1") ]; ... The better way to write the above: if iwlist wlan0 scan | ...


1

Two to the left of Backspace by the looks of it: Edit I've just read elsewhere that it's ctrl+$ on AZERTY, which makes sense as it's the same physical placement. (http://www.madrouter.com/pemu-pix-emulation-and-dynamips/ then ctrl+f "AZERTY") Backed up again here: http://www.generation-nt.com/reponses/quitter-telnet-entraide-198084.html?page=2


1

I haven't checked libgit2, but neither git nor various $PATH users – such as the Glibc execvpe() function and various shells (dash, bash) – support any form of escaping – if a directory name contains a :, it simply cannot be used as part of path-related environment variables. On Windows, the path separator is ; – you should be able to use PATH_SEP or a ...


1

Sed is doing it, it uses a regex in the "find" section. it uses BRE or ERE or PCRE depending on the switch. Backslash is special within a regex. Added I haven't used your version of using single quotes 'cos that makes no sense to me in cmd.exe!! cmd.exe uses double quotes if at all. And it works fine. tested with gnuwin32's sed run from cmd.exe as it is ...


1

You have not said what OS you are using. The following solutions work for Linux (not only for curl but most kinds of escaping: Put the file name in quotes (you need to escape them as well): curl --progress-bar -F "fileUpload=\"@yes, this filename has a comma.txt\"" Escape the comma curl --progress-bar -F "fileUpload=@yes\, this filename has a ...


1

As explained in the manual, all scripts run with sh -e. That means any unhandled command failure will terminate the script with an error. If you have code which might return failure, you would code it like command || true or wrap it in a conditional or something. By the by, your code is better written as ps ax | grep "[p]ostgres: wal writer process" ...


1

Unfortunately that script has some quoting issues. It will work if you add this function to the code: date () { command date "$*" } Actually you don't need to alter the source. Do this: define the "date" function and export it: $ date() { command date "$*"; } $ export -f date $ annotate-output "+foo %T" bash -c "echo stdout; echo stderr ...


1

It will work if you quote parameter properly: annotate-output '+"myscript: %H:%M:%S"' echo "A" date command's format argument starts with +. That's right. But in order to pass space into it you should wrap all chars after + with quotes. Otherwise it will accept symbols which are following the whitespace as second command line argument.


1

A better way is: #!/bin/bash -xv REM_DIR="/home/jan/rem-dir" SSHOPTS=(-C -c arcfour256 -o "ServerAliveInterval 15") SSHUSER="jan@example.com" REM_FILES=`ssh "${SSHOPTS[@]}" "$SSHUSER" "find \"$REM_DIR/\" -path \"*lost+found\" -prune -o -type f -printf \"%P\\n\""` The main problem was with $SSHOPTS, the trick is to put each argument in a separate element ...


1

I now have a working model for all characters except \n: sub shell_quote_scalar { # Quote the string so shell will not expand any special chars # Returns: # string quoted with \ as needed by the shell my $a = shift; $a =~ s/([\002-\011\013-\032\\\#\?\`\(\)\{\}\[\]\*\>\<\~\|\; \"\!\$\&\'\202-\377])/\\$1/g; $a =~ ...



Only top voted, non community-wiki answers of a minimum length are eligible