how to make two scripts in sed. one after the other
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
How can we use a file to make a script in sed
and then using that script again to translate the text? For example,
if we have a morse code file to be translated in sed
and again use that script to translate English text to morse code.
sed
add a comment |Â
up vote
0
down vote
favorite
How can we use a file to make a script in sed
and then using that script again to translate the text? For example,
if we have a morse code file to be translated in sed
and again use that script to translate English text to morse code.
sed
Please give an example of the input, the expected output and why do you think that you need an intermediate file. You already know how to write ansed
script to translate text to morse code directly, the same way you could translate back with a fixed script. Why do you think you would need a dynamical script?
â Philippos
Apr 18 at 10:29
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
How can we use a file to make a script in sed
and then using that script again to translate the text? For example,
if we have a morse code file to be translated in sed
and again use that script to translate English text to morse code.
sed
How can we use a file to make a script in sed
and then using that script again to translate the text? For example,
if we have a morse code file to be translated in sed
and again use that script to translate English text to morse code.
sed
edited Apr 18 at 10:12
Kusalananda
102k13199315
102k13199315
asked Apr 18 at 9:24
Somojel
212
212
Please give an example of the input, the expected output and why do you think that you need an intermediate file. You already know how to write ansed
script to translate text to morse code directly, the same way you could translate back with a fixed script. Why do you think you would need a dynamical script?
â Philippos
Apr 18 at 10:29
add a comment |Â
Please give an example of the input, the expected output and why do you think that you need an intermediate file. You already know how to write ansed
script to translate text to morse code directly, the same way you could translate back with a fixed script. Why do you think you would need a dynamical script?
â Philippos
Apr 18 at 10:29
Please give an example of the input, the expected output and why do you think that you need an intermediate file. You already know how to write an
sed
script to translate text to morse code directly, the same way you could translate back with a fixed script. Why do you think you would need a dynamical script?â Philippos
Apr 18 at 10:29
Please give an example of the input, the expected output and why do you think that you need an intermediate file. You already know how to write an
sed
script to translate text to morse code directly, the same way you could translate back with a fixed script. Why do you think you would need a dynamical script?â Philippos
Apr 18 at 10:29
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
Since I don't know what a morse code file is (but I remember your previous question), I suppose it would be a script like
#!/bin/sh
# Some code that creates the sed script "translate.sed"
# goes here. We can't really know how to do this because
# we don't know what a "morse code file" is.
# Run the just-created script on a file which was
# given on the command line:
sed -f translate.sed "$1"
If this script is called do_translate.sh
, you would run it as
$ ./do_translate.sh text_file.txt
where text_file.txt
is a file that you would want to translate into Morse code.
However, it seems strange that you would want to create the sed
script every time you run the above script. I would probably create translate.sed
once and for all and use that directly, as I mentioned in my previous reply to you.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Since I don't know what a morse code file is (but I remember your previous question), I suppose it would be a script like
#!/bin/sh
# Some code that creates the sed script "translate.sed"
# goes here. We can't really know how to do this because
# we don't know what a "morse code file" is.
# Run the just-created script on a file which was
# given on the command line:
sed -f translate.sed "$1"
If this script is called do_translate.sh
, you would run it as
$ ./do_translate.sh text_file.txt
where text_file.txt
is a file that you would want to translate into Morse code.
However, it seems strange that you would want to create the sed
script every time you run the above script. I would probably create translate.sed
once and for all and use that directly, as I mentioned in my previous reply to you.
add a comment |Â
up vote
0
down vote
Since I don't know what a morse code file is (but I remember your previous question), I suppose it would be a script like
#!/bin/sh
# Some code that creates the sed script "translate.sed"
# goes here. We can't really know how to do this because
# we don't know what a "morse code file" is.
# Run the just-created script on a file which was
# given on the command line:
sed -f translate.sed "$1"
If this script is called do_translate.sh
, you would run it as
$ ./do_translate.sh text_file.txt
where text_file.txt
is a file that you would want to translate into Morse code.
However, it seems strange that you would want to create the sed
script every time you run the above script. I would probably create translate.sed
once and for all and use that directly, as I mentioned in my previous reply to you.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Since I don't know what a morse code file is (but I remember your previous question), I suppose it would be a script like
#!/bin/sh
# Some code that creates the sed script "translate.sed"
# goes here. We can't really know how to do this because
# we don't know what a "morse code file" is.
# Run the just-created script on a file which was
# given on the command line:
sed -f translate.sed "$1"
If this script is called do_translate.sh
, you would run it as
$ ./do_translate.sh text_file.txt
where text_file.txt
is a file that you would want to translate into Morse code.
However, it seems strange that you would want to create the sed
script every time you run the above script. I would probably create translate.sed
once and for all and use that directly, as I mentioned in my previous reply to you.
Since I don't know what a morse code file is (but I remember your previous question), I suppose it would be a script like
#!/bin/sh
# Some code that creates the sed script "translate.sed"
# goes here. We can't really know how to do this because
# we don't know what a "morse code file" is.
# Run the just-created script on a file which was
# given on the command line:
sed -f translate.sed "$1"
If this script is called do_translate.sh
, you would run it as
$ ./do_translate.sh text_file.txt
where text_file.txt
is a file that you would want to translate into Morse code.
However, it seems strange that you would want to create the sed
script every time you run the above script. I would probably create translate.sed
once and for all and use that directly, as I mentioned in my previous reply to you.
answered Apr 18 at 9:34
Kusalananda
102k13199315
102k13199315
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f438464%2fhow-to-make-two-scripts-in-sed-one-after-the-other%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Please give an example of the input, the expected output and why do you think that you need an intermediate file. You already know how to write an
sed
script to translate text to morse code directly, the same way you could translate back with a fixed script. Why do you think you would need a dynamical script?â Philippos
Apr 18 at 10:29