Questions tagged [escaping]
25 questions
1
vote
1 answer
How to make bash treat variables as strings using process substitution
I have the statement:
A=$(echo "echo a") && bash -c "awk -v var=\"$A\" 'BEGIN {printf \"%20s\", var}'"
Which outputs:
echo az
And I can't make this one-liner work:
A=$(echo "echo a") && bash -c "paste <(awk -v var="$A" 'BEGIN {printf…
![](../../users/profiles/195724.webp)
Mindaugas Bernatavičius
- 294
- 3
- 12
1
vote
1 answer
bash: Something like quotemeta() for pattern characters?
Background
I am aware of bash's various string manipulation capabilities.
Also, I know I can escape special pattern characters with a backslash \.
For instance:
# x is a literal string 'foo*bar'
x="foo*bar"
# prints "*bar".
echo "${x##foo}"
#…
![](../../users/profiles/82137.webp)
jwd
- 181
- 7
1
vote
1 answer
SSH hangs every time an escape character is transmitted
I've been asked to continue installation of a freshly installed Debian system. I can log in there through SSH with no problems. But the connection hangs every time the remote shell sends an escape character. For example, all these commands hang the…
![](../../users/profiles/135336.webp)
Petr
- 501
- 1
- 5
- 13
0
votes
1 answer
Ubuntu Server Cron Jobs not running
iam about to blow up: i cant figure out why my jobs in the crontab -e file of any user are not running. None of them do so the "last cron job is not running" problem is not aplicable. Also i checked this thread and couldn't find any mistakes. I even…
![](../../users/profiles/521274.webp)
Salkei
- 13
- 1
- 2
0
votes
1 answer
How to escape pipeline char in Windows shell?
I need to specify a regular expression that includes | character to findstr command:
processtext.exe | findstr /R "Hello|Bye"
How do I escape it? \| does not work. Quotes fix issue with pipelining but the regex does not match although separate…
![](../../users/profiles/74204.webp)
UserControl
- 135
- 1
- 6
0
votes
1 answer
Deal with dashes and spaces in T-SQL String functions
I am searching for the occurrence of a string in a field on a table. The search statement is done through dynamic sql with my statement template looking like this.
SET @sSQL = 'UPDATE #tempProcsAndJobs SET ' +
@columnName + ' = 1 WHERE…
![](../../users/profiles/226535.webp)
Black Dynamite
- 483
- 2
- 5
- 15
0
votes
1 answer
Do modern mail servers still escape lines they think are headers?
For many years I have made it my practice to set up my e-mail clients so that when I forward e-mails I forward them as attachments rather than forwarding them "inline".
I did this because, in the past, often when I forwarded e-mail an intervening…
![](../../users/profiles/35042.webp)
user35042
- 2,601
- 10
- 32
- 57
0
votes
2 answers
batch for loop with bracket in the command
I have a batch file with the following code:
for /f "tokens=*" %%a in ('dir /b /a-d') do (
echo Processing %%a >>%LOG%
dtsrun /S(local) /NNotesLoad /A"FilePath:8="%NOTESDIR%\%%a" /AClientID=%1 >>%LOG%
echo Deleting %%a >>%LOG%
del %%a…
![](../../users/profiles/1171.webp)
benPearce
- 321
- 5
- 11
0
votes
1 answer
Run commands that run in a shell as a script
Running the following commands in a shell runs without issues:
ssh user@machine systemctl status my-service.service
ssh user@machine sudo systemctl stop my-service.service
scp -r ./my-service/* user@machine:/home/user/my-service
ssh user@machine…
![](../../users/profiles/174347.webp)
Ramon Smits
- 145
- 9
-1
votes
3 answers
sed replace text - escape characters
I have a mysqldump file in which I want to replace the following text
![](../../users/profiles/76570.webp)
George Tasioulis
- 1,969
- 2
- 16
- 17