10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi,
Can anyone help me for merge the following multi-line log which beginning with a " and line ending with ": into one line.
*****Original Log*****
087;2008-12-06;084403;"mc;;SYHLR6AP1D\LNZW;AD-703;1;12475;SYHLR6AP1B;1.1.1.1;0000000062;HGPDI:MSISDN=12345678,APNID=1,EQOSID=365;... (3 Replies)
Discussion started by: rajeshlinux2010
3 Replies
2. Shell Programming and Scripting
Hi
OS: Redhat
Version 7.5 Enterprise
Trying to post message from shell script to Slack channel and trying below code:
text="$msg"
text1="$lmsg"
if ]
then
echo "No text specified"
exit 1
fi
escapedText=$(echo $text | $text1 | sed 's/"/\"/g' | sed "s/'/\'/g" )... (13 Replies)
Discussion started by: onenessboy
13 Replies
3. Shell Programming and Scripting
Input File:
>Seq1
ASDADAFASFASFADGSDGFSDFSDFSDFSDFSDFSDFSDFSDFSDFSDFSD
>Seq2
SDASDAQEQWEQeqAdfaasd
>Seq3
ASDSALGHIUDFJANCAGPATHLACJHPAUTYNJKG
......
Desired Output File
>Seq1
ASDADAFASF
ASFADGSDGF
SDFSDFSDFS
DFSDFSDFSD
FSDFSDFSDF
SD
>Seq2 (4 Replies)
Discussion started by: patrick87
4 Replies
4. Shell Programming and Scripting
It looks like if matching and deleting the last line confuses 'sed' so it does not recognize '$' address. Consider:
sed -e '/^3/d' -e '$ a text'
supposed to delete a line starting with '3' and then append 'text' after the last line of input. But, if it is the last line of input which starts... (2 Replies)
Discussion started by: msz59
2 Replies
5. Shell Programming and Scripting
I have a file with data records separated by multiple equals signs, as below.
==========
RECORD 1
==========
RECORD 2
DATA LINE
==========
RECORD 3
==========
RECORD 4
DATA LINE
==========
RECORD 5
DATA LINE
==========
I need to filter out all data from this file where the... (2 Replies)
Discussion started by: Finja
2 Replies
6. Shell Programming and Scripting
Hello all, I have been asked to exercise my shell scripting and it has been 10 plus years since I used to do it so I can not remember hardly anything and ask for your help.
What I need to do is copy a line out of a file that can be 10 to 100 characters long, I then need to parse this line into... (3 Replies)
Discussion started by: Alivadoro
3 Replies
7. Shell Programming and Scripting
Hello Everybody,
I have a file with data like this
8z:1
15y:0
7x:0
12w:1
...
...
I would like read each line through a loop and will needing to get the input from each line like this
For 8z:1; a=8,b=1
15y:0; a=15,b=0
7x:0; a=7,b=0
Please let me know of a way to... (5 Replies)
Discussion started by: leo.maveriick
5 Replies
8. Shell Programming and Scripting
I am trying to write a script that will help me put a file into excel with little manipulation. Below is a sample of the file im using.
Group1:*:gid1:user,user
Group2:*:gid2:user,user
Group3:*:gid3:user,user,user,user,user,user,user
Group4:*:gid4:user,user
I marked in red the part that is... (1 Reply)
Discussion started by: rookieuxixsa
1 Replies
9. Shell Programming and Scripting
Hi,
I want to do the following validations in my script when my script gets 2 parameters as command line inputs.
My script expects 2 inputs : a -f option and a filename
If a filename is given as input without the -f option then I have to exit. If only -f option is given and no filename is... (6 Replies)
Discussion started by: sendhilmani123
6 Replies
10. Shell Programming and Scripting
Hi,
I have a script called read.sh that takes a file as input. Now I want to make that script take the file as input with a -f option preceding the filename. How can I do this validation. How can I find whether the given option is -f or not inside the script.
Thanks in advance (2 Replies)
Discussion started by: sendhilmani123
2 Replies