I have a file a.txt and I want to find slashes(/ and \ ) in it, so I used this command in my a.ksh script slashcheck=cat a.txt | grep '/'.
but how do I check for '' backward slash at the same time?
I have a file a.txt and I want to find slashes(/ and \ ) in it, so I used this command in my a.ksh script slashcheck=cat a.txt | grep '/'.
but how do I check for '' backward slash at the same time?
Try using a regular expression.
You could use something like grep -E '[/\\]'.
Note that you will need two backslashes because the first one masks the second one.
Using squared brackets allows any character in these brackets to be a match.
The -E stands for extended and allows regular expressions to be used as seach patterns.