0
votes
1answer
23 views

Mandatory argument for script to run java program

My script is called: report_startDate It has the following line: $JRE_ROOT/bin/java -cp /home/me/report/config/:/home/me/report/jar/reporting-1.0-SNAPSHOT.jar com.me.project.report.Main $1 $1 ...
0
votes
1answer
36 views

How to evaluate a variable length in shell script?

I want to write a shell script, in which it will call different command according to the variable length. But I didn't figure it out yet. My unwork script is here: for i in n5 n25 if ${#i} == 2; ...
1
vote
0answers
39 views

How to properly start and stop shell script in linux, busybox?

I am trying to write a small shell script that would send some commands to my tv set from my set top box that has busybox on it. The problem is that it generates huge amount of zombie processes, and ...
1
vote
1answer
25 views

bash script not being run by cron [duplicate]

I have a very simple bash script that runs flawlessly when I do ./removeOldBackup.sh or sh /home/myusername/backup/removeOldBackup.sh but when I add it to crontab like * * * * * sh ...
2
votes
1answer
27 views

Fetching Remote Windows System Information From Linux Server

I need a script/command that would fetch Windows System Information (Host Name,User Name, Domain, OS Info, Hardware Info, Memory Info, processor Info, etc) by running it on a Linux Server (RHEL 6.5 ...
5
votes
4answers
528 views

generate consistent machine unique ID

Can we generate a unique id for each PC, something like uuuidgen, but it will never change unless there are hardware changes? I was thinking about merging CPUID and MACADDR and hash them to generate ...
2
votes
1answer
70 views

Accumulate Filename in a Log file using shell script

I have files with their names as ABC_-_123321.20140505_-_161500.CSV ABC_-_654145.20140506_-_135020.CSV String_-_SerialID.Date_-_Time.CSV StartDate, StartTime, EndDate and EndTime are given as ...
2
votes
0answers
39 views

Scripts cannot run simultaneously on startup

I want two scripts (Server_drive, Server_video_boot) running on startup, but there is conflict between them. Specifically, there is always running the script with the lower priority. I tried with many ...
2
votes
0answers
33 views

Creating multicast join for tcpdump captures

I want to write a linux shell script which will capture specific multicast traffic. Specific as in, I want to create a pcap file that has all the traffic for one specific multicast group/port. Here ...
2
votes
1answer
68 views

After printing the previous line where the file contains a single token now need to traverse through the result to meet the requirement

I have used the below code to print the previous line where the file contains a single token #! /bin/ksh file=input.txt while read line do awk 'NF == 1 { print LAST } { LAST=$0 }' done < "$file" ...
0
votes
1answer
53 views

Disable Touchpad automatically at startup

I'm running Mint 17 Mate on a new HP250 laptop. I can turn off the touchpad by typing the following from terminal: synclient TouchpadOff=1 Now I want to disable the touchpad automatically each time ...
3
votes
4answers
159 views

How to cut everthing until a specific word / after a find in a script

Hello I try to get the output of files from today wich contains ERROR. I use this to find the files I want: find /home/user/logfilesError/ -maxdepth 1 -type f -name "gandalf_*"\ -daystart -mtime ...
1
vote
1answer
47 views

What priority should I give to a script running on startup?

I 'm running Angstrom distribution on an embedded device. I want to make use of its GPIO expansion ports, that are set to be high on start-up. Below, is the code segment, that releases an expansion ...
0
votes
0answers
41 views

Specific Jar file doesn't run on startup

I want to run a jar at startup, so I asked a question here. I was given a few suggestions, so I started from trying to create a script file and desktop file. I created a script file and desktop file ...
1
vote
1answer
52 views

Using kornshell or Perl to circumvent permissions needed by root

I have a problem where I need to change the ownership and permissions of one file that exists on more than 200 servers. I belong to 2 different groups and need to change the ownership from one group ...
5
votes
3answers
1k views

Prompt user to login as root when running a shell script

The problem I am getting is, when I enter the command, su - root at the beginning of my shell script file, it prompts the user to enter the password and then does NOT continue with the rest of the ...
1
vote
2answers
118 views

Run jar on startup in all *nix based systems

I have a jar file which I need to run at startup in all distros of Linux. My previous question here, gave me an idea a rough idea on X-servers. Since I wasn't able to perform startup, I moved on to ...
3
votes
1answer
111 views

Automatically detect when a file has reached a size limit

I would like to send an email when a file reach a certain size limit. The only way I thought of doing this is by doing a cronjob which will check the file size and send the email if the file is ...
0
votes
0answers
26 views

Overlapping of cron instance

While searching for a solution to synchronize cron (i.e. only one instance of cron run at at time). I found the solution, given below, on StackExchange. #!/bin/sh LOCK=/var/tmp/mylock if [ -f $LOCK ...
1
vote
2answers
103 views

How to properly launch a program and make possible to redirect its running output (stdout and stderr) at a later stage?

The problem is quite simple: I find useful to have the possibility to switch on (and off) the output of some running program in each moment I need. To be more precise I want to be free to redirect ...
3
votes
1answer
417 views

Why does the filename contains question marks when I run a script on my remote machine?

I have a tiny script that simply fetches the current date, runs a PHP script and redirect the output (and errors) to a filename containing the current date. DATE=$(date +"%Y%m%d") ...
2
votes
1answer
45 views

I'm trying to count and print song file names using awk as following

RANK NAME BAND YEAR GENERE DOMESTIC/INTERNATIONAL 206:Reach Out, I'll Be There:The Four Tops:1978:Pop:3/2 207:Bye Bye Love:The Everly Brothers:1950:Classic:3/2 ...
2
votes
1answer
54 views

Problem on running Script on host after connecting

I am new to linux scripting. Please help. I searched on below a lot but was not able to find appropriate answer : I am trying to make a script which I will later schedule as cronjob, so that it keeps ...
0
votes
1answer
102 views

How to take incremental backup in tape drive

I am having 1 tape drive and I want to take incremental backup of 5 folder to the tape drive on every Friday. But the location of the five folders are on one server and the LTO mounted on a different ...
6
votes
4answers
1k views

How to extract logs between two time stamps

I want to extract all logs between two timestamps. Some lines may not have the timestamp, but I want those lines also. In short, I want every line that falls under two time stamps. My log structure ...
1
vote
1answer
49 views

Shell script fails to run on startup

I want an executable program to run on startup. For this reason, I created a shell script: /etc/init.d/server. Then I run chmod +x name_of_script and update-rc.d server defaults. server (script): ...
0
votes
1answer
73 views

Recursively delete hidden directory & its files?

I want to delete all hidden directoris from a directory and its sub-directory. I also use rm -rf .directory_name this command is iterative command I want to a recursive command. Please anybody help ...
4
votes
2answers
116 views

How to kill a process started as daemon?

I start a process using foo &. It outputs something like: [1] 16915 This is the process id, I guess. How can I store this number into a variable named MY_PROCESS_ID (for example)? Then I ...
1
vote
1answer
48 views

mailx and HP-UX to RedHat migration

We are migrating some servers from HP-UX to Linux RedHat, and we have to migrate about 100 shell scripts that are referencing /usr/bin/mailx (instead of /bin/mailx on Linux). We'd like to change all ...
-1
votes
2answers
91 views

Add users from dat file

I have a dat file with names. These are the names of users I must add, without groups or passwords. Ofcourse i have to remove all spaces. I have to add them with a bash script. Can anyone help me ...
-1
votes
2answers
59 views

how to get the return value of wpa_supplicant?

My question is really simple I want to get the return value of the command wpa_supplicant, when connected to the internet, to know that I am connected or not with a shell script.
14
votes
4answers
1k views

How Does Linux deal with shell scripts?

For this question, let's consider a bash shell script, though this question must be applicable to all types of shell script. When someone executes a shell script, does Linux load all the script at ...
0
votes
2answers
60 views

How to search '(+1)' character substring in a string

I want to search for (+1) in a string (which is a GDG dataset name to confirm if it is a GDG) and want to get a binary answer if it has (+1) as part of the string or not. Can some one please help?
0
votes
0answers
59 views

How to install libevent tmux?

I've been trying to install libevent / ncurses / tmux into '$HOME/local', but am having an issue running .configure for tmux. What I am trying to do is install it as follows: TMUX_VERSION=1.8 ...
2
votes
1answer
242 views

Find out if files in a folder exist under other name in other folder

Possibly a little incorrect English ahead: There are at least 2 folders. For this, A contains files without extension, usually usernames, and B contains similar files, with '.yml' extension or ...
1
vote
2answers
87 views

What's the difference between print and head?

I know head gives you the beginning section of a file. But in this case, I'm trying to go through my source control and find every file that has a shebang line. And I'm failing to get results when I ...
-1
votes
1answer
56 views

Remove directory without `rm -r`

How to remove non-empty directory without using rm -r or find -delete ? I think it is related to unlink, perl or inode
0
votes
3answers
78 views

remove new lines

My input is a csv file like this: 10,"Special Projects,bangaram",0,,0 10,"Statutory/ Internal Audit , MO reporting (incl Excel Spreadsheet uploadation) ", bangaram,0,,0 10,"Complience with ...
4
votes
3answers
3k views

Adding a Column of values in a tab delimited file

How can I add a Column of values in a file which has a certain number of rows. I have a input file like this: Input file: SPATA17 1 217947738 LYPLAL1 1 219383905 FAM47E 4 77192838 SHROOM3 4 ...
2
votes
1answer
161 views

bash script - need date command variable

I am trying to create a script that will parse the /var/log/secure file for failed login attempts for today's date only and redirect those attempts into a separate file so I can view those attempts ...
1
vote
3answers
216 views

What does “FILENAME=$(echo $INFILE | grep -oE ”[^/]+$“) ” mean?

FILENAME=$(echo /root/Source/code/script.sh | grep -oE "[^/]+$") I know that it would give me the file name from the file path here as script.sh. But can some one please explain me this?
-1
votes
1answer
37 views

growing up with linux scripting and online resource to learn it [closed]

Is learning Linux shell scripting good for developing own career?I use linux and very much interested in scripting. Where should I start from?
0
votes
1answer
43 views

Is it a bad idea to keep scripts in /root? [closed]

Is it a bad idea to keep scripts in /root? Simple bash scripts that have the following permissions: -rw-r--r-- They execute fine when ran as root, but is this bad practice? It's a multi-user system, ...
4
votes
2answers
207 views

Dump process's stdin and stdout

I have two processes, let's say Parent and Child. Parent launches the Child and communicates with it through child's stdin and stdout. Parent <-> Child These processes use text protocol and I ...
2
votes
1answer
72 views

Monitor setup commands do not work in script

I'm running Arch Linux 64-bit on a Samsung RV511. I often connect external monitors using xrandr. As I run LXDE with Awesome as a window manager, I need to prepare the xrandr-command by killing ...
0
votes
1answer
289 views

Basic script in Angstrom Linux running on a Beaglebone Black

On my embedded system, I can toggle a user led with: echo > 1 sys/class/leds/beaglebone:green:usr2/value. Similarly, I can find the value of a GPIO (gpio60) (set to input), with more ...
1
vote
1answer
116 views

Bash Script which can direct stdin stream to program

I am trying to create a script capable of infinitely processing an incoming stream which is piped to it, and continuous producing an output stream which can be piped to something else something as ...
2
votes
1answer
57 views

Can I apply `tmux` to a bash script?

Is it possible for me to use tmux to SSH into a Raspberry Pi, run a Bash script, and then leave the session (from my laptop), while the Raspberry Pi continues to run the script?
0
votes
1answer
108 views

How I append the data of Multiple files into one file?

I want to append data of approx 500 files into one file and each of these files are located in their respective dirs. Also How i can verify the contents of merged file e.g How i verify that data ...
1
vote
1answer
73 views

How to FILTER the files with filename and then DELETE the OLDEST file from there? [duplicate]

I create and keep the following automated backup files e.g.: fruits_29-12-2013.gz fruits_30-12-2013.gz fruits_31-12-2013.gz sweets_01-12-2013.gz sweets_02-12-2013.gz sweets_03-12-2013.gz .. ...