Print


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Print
# 1  
Old 02-15-2019
Print

Hi,

I wonder what does :

Code:
 export pubkey=$(cat ~/.ssh/id_rsa.pub)

print "from=\"$host_ad\",something $pubkey"



Thanks for explanation.

Last edited by big123456; 02-15-2019 at 04:30 AM..
# 2  
Old 02-15-2019
If that text is sitting in a file that is never executed, it just sits there.

If it is in a file that is executed by a shell, it depends on what shell is being used to interpret that file.

What file is it in? What operating system are you using? What shell is being used to interpret this file?

Is there a definition for the variable host_ad in this file before the lines you have shown us? If not, is there a definition for that variable exported in the environment of the process that invokes the file that contains this text?
# 3  
Old 02-15-2019
Hi,
Thank you.
What file is it in? A script that will be executed to verify or configure ssh connection.
What operating system are you using? Linux redhat or Unix AIX.
What shell is being used to interpret this file? ksh.

Is there a definition for the variable host_ad in this file before the lines you have shown us? No. But seems to be an ip address.
is there a definition for that variable exported in the environment of the process that invokes the file that contains this text? As I can see it is the content of id_rsa.pub which is a SSL certificat.
Thanks and regards.
# 4  
Old 02-15-2019
ksh comes in (at least) two versions, and the two OSes you mentioned seem to used different ones as their default. Having said this, man ksh usually helps. see below quotations.

Quote:
Originally Posted by big123456
...
Code:
 export pubkey=$(cat ~/.ssh/id_rsa.pub)

Quote:
export [ -p ] [ name[=value] ] ...
... the given names are marked for automatic export to the environment of subsequently-executed commands.
Quote:
Command Substitution.
The standard output from a command list enclosed in parentheses preceded by a dollar sign ( $(list) ), or in a brace group preceded by a dollar sign ( ${ list;} ), or in a pair of grave accents (``) may be used as part or all of a word; ...
So - a variable called pubkey is - by "command substitution" - assigned the stdout of a cat command and marked for export.
Quote:
Code:
print "from=\"$host_ad\",no-port-forwarding $pubkey"

...
Quote:
print [ -CRenprsv ] [ -u unit] [ -f format ] [ arg ... ]
With no options or with option - or --, each arg is printed on standard output. ...
So - you'll have something like
Code:
from="",no-port-forwarding ssh-rsa AAAA...

on your stdout, usually your screen.

Last edited by RudiC; 02-15-2019 at 04:35 AM..
# 5  
Old 02-15-2019
Thanks.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Setting up Solaris 10 to print to a windows print server

Guys, I have a issue that I am trying to rectify please advise. lpstat -t shows scheduler is running printer lext644 disabled since Mon Dec 02 19:48:18 2013. available.I have restarted the printer service and it shows online but the above says disabled. I have a lot of jobs in the print... (1 Reply)
Discussion started by: terrywhitejr
1 Replies

2. UNIX for Dummies Questions & Answers

How to create a print filter that print text & image?

Currently, I have a print filter that takes a text file, that convert it into PCL which then gets to a HP printer. This works. Now I need to embedded a image file within the text file. I'm able to convert the image file into PCL and I can cat both files together to into a single document... (1 Reply)
Discussion started by: chedlee88-1
1 Replies

3. UNIX for Advanced & Expert Users

[Solved] remove all print jobs from a print queue

Hello, Sometimes i need to clear all the jobs of a print queue and it is really annoying to cancel one by one. Is there a way to cancel all print jobs for a specific print queue with a single command instead of cancelling them one by one? My AIX system is 5.3 Thank you for your attention (2 Replies)
Discussion started by: omonoiatis9
2 Replies

4. Shell Programming and Scripting

print first few lines, then apply regex on a specific column to print results.

abc.dat tty cpu tin tout us sy wt id 0 0 7 3 19 71 extended device statistics r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device 0.0 133.2 0.0 682.9 0.0 1.0 0.0 7.2 0 79 c1t0d0 0.2 180.4 0.1 5471.2 3.0 2.8 16.4 15.6 15 52 aaaaaa1-xx I want to skip first 5 line... (4 Replies)
Discussion started by: kchinnam
4 Replies

5. Shell Programming and Scripting

print lines AFTER lines cointaining a regexp (or print every first and fourth line)

Hi all, This should be very easy but I can't figure it out... I have a file that looks like this: @SRR057408.1 FW8Y5CK02R652T length=34 AGCAGTGGTATCAACGCAGAGTAAGCAGTGGTAT +SRR057408.1 FW8Y5CK02R652T length=34 FIIHFF6666?=:88@@@BBD:::?@ABBAAA>8 @SRR057408.2 FW8Y5CK02TBMHV length=52... (1 Reply)
Discussion started by: kmkocot
1 Replies

6. Shell Programming and Scripting

Howto Print File Path or Print the Filename

I'm trying to clean up my samba share and need to print the found file or print the path of the image it tried to searched for. So far I have this but can't seem to get the logic right. Can anyone help point me in the right direction? for FILE in `cat list`; do if ; then ... (1 Reply)
Discussion started by: overkill
1 Replies

7. Solaris

Print to ps2pdf print queue

I am trying to create a printer queue, on a SunOS 5.7 system, that outputs a pdf file. There is an application running on the system that has a print button, which sends print files to the default printer. If I disable the printer, I am able to manually capture the files in /var/spool/lp/tmp and... (2 Replies)
Discussion started by: Sean_69
2 Replies

8. UNIX for Dummies Questions & Answers

Print to a ps2pdf print queue.

I am trying to create a printer queue, on a SunOS 5.7 system, that outputs a pdf file. There is an application running on the system that has a print button, which sends print files to the default printer. If I disable the printer, I am able to manually capture the files in /var/spool/lp/tmp and... (1 Reply)
Discussion started by: Sean_69
1 Replies

9. HP-UX

Print Problem in UNIX. Need to know the option to specify the print paper size

Hi, Could any one please let me know what is the option available in UNIX to print by specifying the paper size? We are using Unix11i. I could n't see any option specified in the 'lp' command to print the report by specifying the size of the paper. It would be of great help to me, if... (1 Reply)
Discussion started by: ukarthik
1 Replies

10. Shell Programming and Scripting

How do I get awk to print a " in it's print part?

The line is simple, use " '{ print $1"]"$2"\"$3THE " NEEDS TO GO HERE$4 }' I've tried \", "\, ^" and '"" but none of it works. What am I missing? Putting in the [ between $1 and $2 works fine, I just need to do the same with a ". Thanks. (2 Replies)
Discussion started by: LordJezo
2 Replies
Login or Register to Ask a Question