10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How to match a shell variable that contains parenthesis (and other special characters like "!")
file.txt contains:
Charles Dickens
Matthew Lewis (writer)
name="Matthew Lewis (writer)";
awk -v na="$name" ' $0 ~ na' file.txt
Ideally this would match $name in file.txt (in this... (3 Replies)
Discussion started by: Mid Ocean
3 Replies
2. Shell Programming and Scripting
Hi,
I am fairly new to unix scripting and recently tasked with some reporting scripts.
The reporting checks several batch jobs and this is quite iterative.
Now I am trying to minimize script effort and maximize reusability as there are only slight nuances in the repetitive tasks.
For... (3 Replies)
Discussion started by: joeniks
3 Replies
3. Shell Programming and Scripting
Hey guys,
I know that title is a mouthful - I'll try to better explain my struggles a little better...
What I'm trying to do is:
1. Query a db and output to a file, a list of column data.
2. Then, for each line in this file, repeat these values but wrap them with:
ITEM{
... (3 Replies)
Discussion started by: ampsys
3 Replies
4. UNIX for Dummies Questions & Answers
Hello all,
I am facing with a problem of invoking an environment variable.
If I use this command :
/bin/ls -lt FILE_NM_?(20120515|20120516)??????_sas.sig | head -n1 | awk '{print $9}'
It perfectly outputs the desired result.
FILE_NM_20120516000000_sas.sig
But if I do this:... (8 Replies)
Discussion started by: sethmj
8 Replies
5. Shell Programming and Scripting
i need to replace the any special characters with escape characters like below.
test!=123-> test\!\=123
!@#$%^&*()-= to be replaced by
\!\@\#\$\%\^\&\*\(\)\-\= (8 Replies)
Discussion started by: laknar
8 Replies
6. Shell Programming and Scripting
Hey guys,
I'm trying to replace "]Facebook" from the text
but
sed 's/]Facebook/Johan/g'
is not working
could you please help me with that? (6 Replies)
Discussion started by: Johanni
6 Replies
7. Shell Programming and Scripting
This has been covered many times earlier but couldnt figure the issue myself. Can you please advise whats wrong on the below code
I have a variable with special character ($) and am using that variable to replace another variable in file but however sed is failing to parse it correctly
... (7 Replies)
Discussion started by: sasiharitha
7 Replies
8. Shell Programming and Scripting
When I open a file in vi, I see the following characters:
\302\240
Can someone explain what these characters mean. Is it ASCII format? I need to trim those characters from a file.
I am doing the following:
tr -d '\302\240'
---------- Post updated at 08:35 PM ---------- Previous... (1 Reply)
Discussion started by: sid1982
1 Replies
9. Shell Programming and Scripting
Hello,
I am trying the following:
echo __CHANGEME__ >> testfile
VAR1="&&&"
sed -i "s|__CHANGEME__|${VAR1}|" testfile
cat testfile
This results in testfile containing
__CHANGEME____CHANGEME____CHANGEME__
Whereas I want it to result in
&&&
I understand that if
VAR1="\&\&\&"
then... (3 Replies)
Discussion started by: linuxnewbeee
3 Replies
10. UNIX for Dummies Questions & Answers
I have one file which is named ^? ( the DEL character )
I'd like to know how to rename or copy the file by using its i-node number
TYIA (2 Replies)
Discussion started by: nawnaw
2 Replies