Skip to content
Advertisement

Tag: unix

Run a perl script with the ending .pl

I have a question to perl scripts. I can write and understand C and C++ codes but have no experience in perl. I have a perl script with the extension .pl and want to run it on a Raspberry Pi Model B. I get the script (its a part of the Raspberry Pi B extension ‘Busware SD0’ Firmware) from this

Terminal – current directory symbol [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question

why file with hole has smaller disk block than file without hole?

I’m newbie in unix system programming There is code making file with hole. Output result is: Why file with hole has fewer disk block than file without hole? In my thinking, file without hole takes smaller disk blocks Because file with hole is more spreaded than without hole.. From “Advanced Programming in the UNIX Environment 3rd-Stevens Rago, example 3.2” Answer

Why does (ps -f) create no subshell but a separate process?

I need some help because I don’t get something. From what I read from Internet, a subshell is created when we execute a shell script or if we run command in brackets: ( ) I tried to test this with a script which contains only the following command: When I run it I see the following result: Which is good,

Check if a condition is false

It is seems to be an easy question, I wonder why googling didn’t give anything helpful — nor in StackOverflow, nor in tutorials. I just need to check using bash that a condition is false. Of what I found I tried and none of them print Hello. I found only two similar questions, but the end answer in both cases

All possible exit codes for cp

Looking at the man pages for cp, I only found that the command exits with 0 when copy succeeds with no error, and with a number greater than 0 on any error. However I couldn’t find any detailed description on specific exit codes mapped to specific cases. Is there such a description anywhere, is it even standardized, or each Unix/Linux

How to cat <> a file containing code?

I want to print code into a file using cat <<EOF >>: but when I check the file output, I get this: I tried putting single quotes but the output also carries the single quotes with it. How can I avoid this issue? Answer You only need a minimal change; single-quote the here-document delimiter after <<. or equivalently backslash-escape it:

Check if a directory exists and is accessible

I want to check if a directory exists and it has access rights; if it does, then perform the tasks. This is the code I wrote, which might not have proper syntax. Can you help me to correct it? I believe this can also be written like this. How can we write this more efficiently? Answer The best way to

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 alternative (ugly)

Advertisement