Skip to content

Tag: linux

sending email in linux as subject and attachment

I have a file that is about 10 columns wide and try to send it as body. mailx fails sending it as body and sends it as a ATT00001.bin file and as an attachment. mail -s “Subject” emailaddress < file.tsv Is there way to solve this. When I try to send it as an attachment, using uuencode echo &#82…

cut or awk command to print first field of first row

I am trying print the first field of the first row of an output. Here is the case. I just need to print only SUSE from this output. Tried with cat /etc/*release | awk {‘print $1}’ but that print the first string of every row Answer Specify NR if you want to capture output from selected rows: An al…

Shell script: Run function from script over ssh

Is there any clever way to run a local Bash function on a remote host over ssh? For example: Yeah, I know it doesn’t work, but is there a way to achieve this? Answer You can use the typeset command to make your functions available on a remote machine via ssh. There are several options depending on how y…

linux sed, do insert and append at the same time

I have a question about linux sed command. I just want to insert something before every line and append something after every line. And i want to do these things at the same time. For example, assume file.txt is like: I need to output: so I think the command should be like: But the result is not right, a is

not allow multiple option in getopts of bash script

Having bash script as follows Above script run fine with different option but i wanted to extend it to not allow to pass multiple option at same time like as following argument should be not valid means some way it give me error like wrong syntax i achieved it by as follows but it seems to long it is as

Can docker run inside a Linux Container?

Koding is a collaborative programming environment, which creates a virtual machine for multiple user to colaborate on software development. They use Linux Containers to virtualize the machines. I’m not being able to install docker on it: Can anyone suggest a workaround for installing docker? Answer Yes,…