Linked Questions

129 votes
3 answers
397k views

I want to assign the result of an expression (i.e., the output from a command) to a variable and then manipulate it – for example, concatenate it with a string, then echo it.  Here's what I've got: #!/...
Nathan G.'s user avatar
  • 1,438
6 votes
2 answers
52k views

I'm trying to write a shell script in RHEL which will execute grub-md5-crypt and the user will type their password. Now the problem is how can I grab the encrypted md5 hash displayed to the user in ...
Tarun's user avatar
  • 276
0 votes
2 answers
30k views

I am connecting to mySQL database using a shell script. After connecting to the mySQL database, I execute a query. The query gives me 300,000 URLs as the result. For each of the 300,000 URLs I need ...
Ramesh's user avatar
  • 40.6k
1 vote
2 answers
24k views

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 ...
baccksash's user avatar
2 votes
1 answer
10k views

I have this command succession: echo -ne "/dev/shm/test.sh" | netcat 89.196.167.2 4567 and let's say it return a string like, for example "Hello...bla". On the 89.196.167.2 system, I have made a ...
Andreea's user avatar
  • 155
3 votes
1 answer
7k views

How can I put the output of head -15 textfile.txt to a variable $X to use it in an if command like this: if $X = 'disabled' then ?
Minimus Heximus's user avatar
1 vote
1 answer
2k views

Possible Duplicate: Storing output of command in shell variable How can I put the result of jps | awk '$2~/Bootstrap/{print $1}' into a variable so that I can use with other commands?
user avatar
-1 votes
1 answer
4k views

If I run export TEST=script.py echo $TEST It outputs script.py script.py code: return 5 can TEST be set to 5? Obviously script will do something in future not just return a number
Bato-Bair Tsyrenov's user avatar
47 votes
3 answers
291k views

Want to get the IP address using Shell script. Without knowing the eth0 or eth1 or eth2 How to get the particular IP address. I am not interest to get localhost address, want to get private IP ...
Beginner's user avatar
  • 2,000
4 votes
3 answers
6k views

This is a basic question regarding bash but I could not find a solution. I have many subdirectories with identically named files and I want to compare all of them for identity. I can return list of ...
DrDom's user avatar
  • 143
1 vote
1 answer
4k views

I am trying to set the variable service to be the value of var1=first/second echo $var1 | cut -d '/' -f 1 var2=$var1 | cut -d '/' -f 1" echo $var2 The result of echo $var1 | cut -d '/' -f 1 is "...
fuzzi's user avatar
  • 13