Posts: 2,581
Threads: 453
Joined: Jan 2022
Reputation:
0
if I'm trying to do something like 'sed - $variable p' to output a specific line, how would I get it so there aren't any spaces? would I have to use tr?
using the above I get sed - X p when I need sed -Xp
Thanks in advance!
Posts: 847
Threads: 37
Joined: Nov 2008
Reputation:
0
Is this what you are looking for:
sed -${variable}p
- Shadow
Posts: 847
Threads: 37
Joined: Nov 2008
Reputation:
0
Or:
CMD=`echo "sed -${variable}p"`
then just put $CMD where you want to execute the command.
- Shadow
Posts: 2,581
Threads: 453
Joined: Jan 2022
Reputation:
0
Thankyou very much shadow!
the first one worked perfectly.
Now, onto finishing it.
Thanks!