Skip to content
Advertisement

Tag: shell

Use of $- in shell script

What is use of $- in Unix. In My system, the output is, what is meant by himBH? what it stands for. Thanks in Advance… Answer It returns the current shell’s flags. The $- variable contains the shell’s flags currently active in your terminal. These flags determine how your shell will function for you. In your case, these flags have

How to print file/directory details using ls and AWK?

I am trying to print the output as below using the command: or But it does not print anything. O/P should be like, (I am using 0777 or 777 because of find . -type f -perm 0777) Answer you’ve got the right idea, but 777 is the octal representation of permissions, and with this you’re looking at the output of

Is there a bug in “zgrep -H”?

Just tried grep and zgrep on following test file: I also need the file-name printed, so I’ve added the -H switch and stepped on the following problem: E.g. depending on POSITION of -H switch in the command-line – the behavior is different for me and the issue always reproduces 🙁 One more test: Here’s the outline of which zgrep I’m

Replace a line with a number if part of it is matches using sed

I know this is a very simple question and been discussed many times, but I can’t understand where I am doing wrong in my command. I would like to replace the lines which starts with “It” as 99999. Each row starts with several blank spaces. I used But it is not working. Answer give this a try:

Amazon AWS EC2 Key Pair Denied

I have scoured the Internet for answers and had little luck. All I have been trying to do is connect to my AWS EC2 Linux server via SSH. The.pem file is on my computer, but it has not been accepted. I have tried several FTP clients, including FileZilla and the native Terminal on my Mac. In FileZilla, my error is

Advertisement