Skip to content

Tag: shell

Obtaining file names from directory in Bash

I am trying to create a zsh script to test my project. The teacher supplied us with some input files and expected output files. I need to diff the output files from myExecutable with the expected output files. Question: Does $iF contain a string in the following code or some kind of bash reference to the file…

“Name or service not knownname” using SSH from script [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 7 y…

bash script – executing find command gives no output

I’m a total noob at bash so this is most likely a syntax error, but I could not find anything that worked for my syntax in my searches. From terminal, running find . -name “*g*” results in However, running this bash script called grepdir.sh from terminal as grepdir.sh . “*g*” res…

concatenate ordered files using cat on Linux

I have files from 1 to n, which look like the following: Each file contains only one line. Now I want to concatenate them in the order from 1 to n. I tried cat sim.o500.* > out.dat. Sadly this does not work if e.g. n is larger than 9, because this concatenates then sim.o500.1 followed by sim.o500.10and not…

Make is unable to find the functions

I am trying to compile a C program, while linking the APR library. I am getting the following error message: cc -g -Wall -pthread -I/usr/local/apr/include/apr-1 -I/usr/local/apr/include/apr-util-1 -L/usr/local/apr/lib -L .aprutil-1 -L .apr-1 devpkg.c bstrlib.o db.o shell.o commands.o -o devpkg /tmp/cczC53x5.o…