All Questions
7
questions
1
vote
0
answers
40
views
compiling ffmpeg with fixed arguments? [closed]
I would like to compile ffmpeg with fixed arguments, ie:
ffmpeg -i rtsp://localhost/live -vcodec copy -acodec copy -f flv rtmp://remotehost/live
I can't for security reasons call it from an external ...
0
votes
2
answers
561
views
bash script: passing arguments to mkfs
I'm writing a bash script to format my partitions. One of the commands I want to run is the following:
mkfs.btrfs -f -m single -L root /dev/sda1
So I have split that command into the options part: -...
6
votes
1
answer
539
views
Why does the ls command require a dash before its parameters but for tar command, the dash is optional?
I am new to Ubuntu and I am trying hard to understand the command line.
When I want to see the contents of a tar file I use:
tar tf tarfile.tar
But when I want to see a listing of all file if I ...
0
votes
1
answer
151
views
Passing different set of arguments to the different commands in a linux bash script
I am writing a bash script foo.sh that runs too commands bar with first input argument, and baz with the second argument:
#! /bin/bash
bar "$1"
baz "$2"
Now I want to make foo.sh more flexible, ...
1
vote
1
answer
741
views
How woulld I add $OPTARGs from one arg to an array
So I'm trying to add values from an optarg to an array. I've got:
arrays=()
while getopts a: args; do
case $args in
a) arrays+=$OPTARG;;
esac
done
echo $arrays[@]
When I run the script, ./...
0
votes
2
answers
7k
views
Why does my Bash script display the "too many arguments" error at the cp command?
Here is my script, I get the error "line 33: [: too many arguments", I'm confused why, surely only 2 arguments are being provided to cp here?
I am providing two directories to the script with no ...
0
votes
1
answer
873
views
option -f for linux command
this is the content of test file:
this this
this that
is that
a that
MAP that
map that
when I do uniq testCase -f1, the result is:
this this
this that
which is reasonable, but if ...