The tag has no wiki summary.

learn more… | top users | synonyms

2
votes
3answers
90 views

In what shared library is read()?

I'm a Linux rookie and want to know where the system call read() is. Which shared library is linked when I call read()?
2
votes
2answers
154 views

Read non-bash variables from a file into bash script

My bash script needs to read the variables from a text file that contains hundreds of variables, most of which conform to standard bash variable sytax (e.g., VAR1=VALUE1). However, a few lines in this ...
1
vote
2answers
94 views

Run a Shell script and read the output in a variable and run another script based on output

I am a novice to Linux system. My requirement is to run a Linux status script which echos a message (message is either "App is running" or "App is not running"). If the message is "App is running" ...
5
votes
3answers
569 views

Bash: interactive remote prompt

I have a script which connects to a remote server and check if some package is installed: ssh root@server 'bash -s' < myscript.sh myscript.sh: OUT=`rpm -qa | grep ntpdate` if [ "$OUT" != "" ] ; ...
2
votes
5answers
105 views

Read contents in a line in bash

I have a file with contents in this order which is separated by space 4096 1230 4560 1024.... n How can i read each number and pass it on to another command, eg divide each number by 1024.
1
vote
1answer
72 views

Read a variable with “read” and preserve backslashes entered by the user

I'm using read to read a path from a user like so: read -p "Input the file name: " FilePath The user now enters this string: \Supernova\projects\ui\nebula What can I do to replace \ with /. The ...
9
votes
3answers
170 views

bash: Using read <<<“$VARIABLE” on a read-only root partition

Just by coincidence I had to use my ATA-ID-to-device-name script (found here: http://serverfault.com/questions/244944/linux-ata-errors-translating-to-a-device-name/426561#426561) on a read-only / ...
1
vote
1answer
143 views

while loop is running only once?

I am trying to make a clip out of video file by playing it only for certain interval. make_mclip.sh #!/bin/bash mediafile=$@ mediafile_fullpath=$PWD/./$mediafile tmpedlfile=$(mktemp) mplayer ...
2
votes
1answer
56 views

Monitoring file reads for cache warming

After adding more memory to my Linux machine I was tempted to use the cache more agressively. The thing is: I boot up my machine, go to bathroom, come back and log in. It takes like half a minute to ...
0
votes
2answers
154 views

Read the output of a command into a variable [duplicate]

I am making a bash script but I'm totally new and got lost. I've made this code cat * | grep "|*parameter1*|" | grep "|*parameter2*|" | cut -f 8,11,12,15,21,23,34 -d "|" | wc -l which works just ...
4
votes
2answers
128 views

read -a array -d '\n' < foo, exit code 1

If I try to execute read -a fooArr -d '\n' < bar the exit code is 1 -- even though it accomplishes what I want it to; put each line of bar in an element of the array fooArr (using bash 4.2.37). ...
1
vote
2answers
131 views

Nested read fails

I have a list of filenames in a file and want to do let the user decide what to do with each. In bash, iterating over filenames is not trivial in itself, so I followed this answer: #!/bin/bash while ...