Skip to content
Advertisement

Tag: unix

How logical operators works

I tried below but it doesn’t work. Throwing some errors. Exp1 or expr2 should evaluate first & at result should be evaluated with expr3 ( &&) i tried as per suggestion, it throws error as Fyi- that date is val1 value. Answer You might see different results based on the shell or version, eg: sh vs bash vs ash. One

How to give permission to root user generated file by other user in linux?

I am trying to giving permission to root user generated file but not able to do this. Can anyone help me how to do this? I tried: Example: Expected result: Answer First of all, I can’t see what you’re doing by “echo -e ‘password'”. The ‘>’ character means “output redirection”, that is, bash will redirect the input of the “echo

Unix -Delete even bytes from a file

I want to find and delete all even bytes from a file given in command line. Is there any command for this situation? Answer I think this does what you want. It dumps the file as continuous plain hex, then reads two bytes, saving them for later and then two more bytes. Then it outputs the bytes it saved and

Unable to use SED command [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question i want to call a shell scripts which has sed command in it to format the xyz.csv generated by this shell. SED gets unrecognised in

How to get unix style prompt in windows (batch)

I am trying to make dos shell which displayes a unix/linux promt. The code is: I want it to display directory name like in unix/linux but it displays a ~. What is wrong in my code? Can you please help me improve it? Answer Probably not quite on the ball with the prompts specific situational substring modification, but the Method

Copy a folder contents and save the file with diff name Unix

I have a bunch of .txt files in a directory. I m looking for a command to copy all .txt files and save it with <filename>_2.txt. Eg: abc.txt -> abc_2.txt (After copy) Thanks in tons in advance Answer EDIT: As per OP’s extension request adding following code now. Try following. Above will print cp commands, if you are ok with

Advertisement